The code powering m.abunchtell.com https://m.abunchtell.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

32 lines
607 B

  1. # frozen_string_literal: true
  2. class Auth::SessionsController < Devise::SessionsController
  3. include Devise::Controllers::Rememberable
  4. layout 'auth'
  5. before_action :configure_sign_in_params, only: [:create]
  6. def create
  7. super do |resource|
  8. remember_me(resource)
  9. end
  10. end
  11. protected
  12. def configure_sign_in_params
  13. devise_parameter_sanitizer.permit(:sign_in, keys: [:otp_attempt])
  14. end
  15. def after_sign_in_path_for(_resource)
  16. last_url = stored_location_for(:user)
  17. if [about_path].include?(last_url)
  18. root_path
  19. else
  20. last_url || root_path
  21. end
  22. end
  23. end