Class: Dailycred::SessionsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Dailycred::SessionsController
- Includes:
- Helpers
- Defined in:
- app/controllers/dailycred/sessions_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
Callback Route for OAuth flow.
-
#destroy ⇒ Object
GET /logout.
- #failure ⇒ Object
- #info ⇒ Object
Methods included from Helpers
#authenticate, #connect_path, #connect_user, #dailycred, #login_path, #redirect_to_auth, #redirect_to_unauth, #set_state
Instance Method Details
#create ⇒ Object
Callback Route for OAuth flow
8 9 10 11 12 |
# File 'app/controllers/dailycred/sessions_controller.rb', line 8 def create @user = User.find_or_create_with_omniauth auth_hash session[:user_id] = @user.id redirect_to_auth end |
#destroy ⇒ Object
GET /logout
15 16 17 18 |
# File 'app/controllers/dailycred/sessions_controller.rb', line 15 def destroy session[:user_id] = nil redirect_to_unauth end |
#failure ⇒ Object
20 21 22 |
# File 'app/controllers/dailycred/sessions_controller.rb', line 20 def failure redirect_to_unauth notice: params[:message] end |
#info ⇒ Object
24 25 |
# File 'app/controllers/dailycred/sessions_controller.rb', line 24 def info end |