I am testing out facebook omniauth. I followed the directions listed on https://coderwall.com/p/bsfitw I followed all 6 setups listed:
- Add Omniauth and Omniauth-Facebook gems.
- Create User model.
- Create Sessions controller
- Create Omniauth initializer
- Showing the logged in user in the View.
This is what my routes file looks like: Rails.application.routes.draw do
root 'welcome#home' get 'about'=>'welcome#about' match 'auth/:provider/callback', to: 'sessions#create', via: [:get, :post] match 'auth/failure', to: redirect('/'), via: [:get, :post] match 'signout', to: 'sessions#destroy', as: 'signout', via: [:get, :post
class SessionsController < ApplicationController def create @user = User.from_omniauth(env["omniauth.auth"]) session[:user_id] = user.id redirect_to root_url end def destroy @session[:user_id] = nil redirect_to root_url end end
I searched through Google numerous times to search and unfortunately, I have not found any solutions that work. Does anyone know what could be the problem?</div