tabletop-companion/app/controllers/account_verifications_contr...

14 lines
418 B
Ruby

class AccountVerificationsController < ApplicationController
def show
user = User.find_by_token_for(:email_verification, params[:id])
unless user
flash[:alert] = t(".error")
redirect_to :root and return
end
user.update(verified: true)
UserMailer.with(user: user).email_verified.deliver_later
flash[:notice] = t(".success")
redirect_to :root # TODO: New session path
end
end