Class: StandardId::Web::VerifyEmail::ConfirmController

Inherits:
BaseController show all
Defined in:
app/controllers/standard_id/web/verify_email/confirm_controller.rb

Constant Summary

Constants included from RateLimitHandling

RateLimitHandling::RATE_LIMIT_STORE

Instance Method Summary collapse

Methods included from StandardId::WebAuthentication

#current_account, #current_scope_names, #current_session, #revoke_current_session!

Methods included from ControllerPolicy

all_controllers, authenticated_controllers, public_controllers, register, registry_snapshot, reset_registry!

Instance Method Details

#showObject



7
8
9
10
# File 'app/controllers/standard_id/web/verify_email/confirm_controller.rb', line 7

def show
  return redirect_to(standard_id_web., alert: "Invalid or expired verification code") if @challenge.nil?
  render plain: "verify email confirm", status: :ok
end

#updateObject



12
13
14
15
16
17
18
19
20
21
22
# File 'app/controllers/standard_id/web/verify_email/confirm_controller.rb', line 12

def update
  return redirect_to(standard_id_web., alert: "Invalid or expired verification code") if @challenge.nil?

  identifier = StandardId::EmailIdentifier.find_by(value: @challenge.target)
  if identifier.present?
    identifier.verify!
  end
  @challenge.use!

  redirect_to standard_id_web., notice: "Your email has been verified. Please sign in.", status: :see_other
end