Class: Magics::SignInsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Magics::SignInsController
- Defined in:
- app/controllers/action_auth/magics/sign_ins_controller.rb
Instance Method Summary collapse
Instance Method Details
#show ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 |
# File 'app/controllers/action_auth/magics/sign_ins_controller.rb', line 3 def show user = ActionAuth::User.find_by_token_for(:magic_token, params[:token]) if user @session = user.sessions.create .signed.permanent[:session_token] = { value: @session.id, httponly: true } user.update(verified: true) redirect_to main_app.root_path, notice: "Signed In" else redirect_to sign_in_path, alert: "Authentication failed, please try again." end end |