Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify flow to add Paste in Token as default #159

Merged
merged 14 commits into from
Sep 7, 2023
Prev Previous commit
Next Next commit
Add docs
  • Loading branch information
mikker committed Sep 7, 2023
commit e064a8c3a1dbc5923a9daf810764d267fc35ef78
12 changes: 11 additions & 1 deletion app/controllers/passwordless/sessions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,19 @@ def create
end
end

# get '/:resource/sign_in/:id'
# get "/:resource/sign_in/:id"
# Shows the form for confirming a Session record.
# renders sessions/show.html.erb.
def show
@session = find_session
end

# patch "/:resource/sign_in/:id"
# User submits the form for confirming a Session record.
# Looks up session record by provided token. Signs in user if a match
# is found. Redirects to either the user's original destination
# or _Passwordless.config.success_redirect_path_.
#
# @see ControllerHelpers#sign_in
# @see ControllerHelpers#save_passwordless_redirect_location!
def update
Expand All @@ -60,6 +62,14 @@ def update
authenticate_and_sign_in(@session, passwordless_session_params[:token])
end

# get "/:resource/sign_in/:id/:token"
# User visits the link sent to them via email.
# Looks up session record by provided token. Signs in user if a match
# is found. Redirects to either the user's original destination
# or _Passwordless.config.success_redirect_path_.
#
# @see ControllerHelpers#sign_in
# @see ControllerHelpers#save_passwordless_redirect_location!
def confirm
# Some email clients will visit links in emails to check if they are
# safe. We don't want to sign in the user in that case.
Expand Down