Class: SessionsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- SessionsController
- Defined in:
- lib/generators/templates/sessions_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
Callback Route for OAuth flow.
-
#destroy ⇒ Object
GET /logout.
- #failure ⇒ Object
- #info ⇒ Object
Instance Method Details
#create ⇒ Object
Callback Route for OAuth flow
6 7 8 9 10 |
# File 'lib/generators/templates/sessions_controller.rb', line 6 def create @user = User.find_or_create_with_omniauth auth_hash session[:user_id] = @user.id redirect_to auth_path end |
#destroy ⇒ Object
GET /logout
13 14 15 16 |
# File 'lib/generators/templates/sessions_controller.rb', line 13 def destroy session[:user_id] = nil redirect_to auth_path end |
#failure ⇒ Object
18 19 20 |
# File 'lib/generators/templates/sessions_controller.rb', line 18 def failure redirect_to auth_path, notice: params[:message] end |
#info ⇒ Object
22 23 |
# File 'lib/generators/templates/sessions_controller.rb', line 22 def info end |