Class: SessionsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- SessionsController
- Defined in:
- app/controllers/sessions_controller.rb
Constant Summary
Constants included from ProjectsHelper
ProjectsHelper::CLASSIFIER, ProjectsHelper::CLASSIFIER_ANNOTATION
Instance Method Summary collapse
-
#create ⇒ Object
POST /sessions.
-
#destroy ⇒ Object
DELETE /signout.
-
#new ⇒ Object
GET /signin.
Methods included from RedirectHelper
Methods included from RequestType
Methods included from LogRecent
Methods included from Cookies
#digest_cookie, #digested_cookie_exists?
Methods included from Whitelist
Methods included from ProjectsHelper
#cumulative_gb_per_year, #document_cumulative_gb_per_year, #document_gb_per_year, #gb_per_year, #image_cumulative_gb_per_year, #image_gb_per_year, #invalid_object, #project_classification, #project_link, #project_matches, #project_tag, #projects_list, #projects_search_form, #taxonworks_classification, #week_in_review_graphs
Methods included from Api::Intercept
Methods included from TokenAuthentication
#intercept_project, #intercept_user, #intercept_user_or_project, #project_token_authenticate, #token_authenticate
Instance Method Details
#create ⇒ Object
POST /sessions
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'app/controllers/sessions_controller.rb', line 8 def create user = User.find_by(email: params[:session][:email].downcase) if user && user.authenticate(params[:session][:password]) unless user.is_flagged_for_password_reset? sessions_sign_in(user, request) redirect_to root_path else @user = user render 'request_password_reset' end else @page_title = 'Sign in' flash.now[:error] = 'Unrecognised email and password combination.' render 'new' end end |
#destroy ⇒ Object
DELETE /signout
27 28 29 30 |
# File 'app/controllers/sessions_controller.rb', line 27 def destroy sessions_sign_out redirect_to root_url end |
#new ⇒ Object
GET /signin
4 5 |
# File 'app/controllers/sessions_controller.rb', line 4 def new end |