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.

29 lines
635 B

  1. # frozen_string_literal: true
  2. class Auth::ConfirmationsController < Devise::ConfirmationsController
  3. layout 'auth'
  4. before_action :set_user, only: [:finish_signup]
  5. # GET/PATCH /users/:id/finish_signup
  6. def finish_signup
  7. return unless request.patch? && params[:user]
  8. if @user.update(user_params)
  9. @user.skip_reconfirmation!
  10. bypass_sign_in(@user)
  11. redirect_to root_path, notice: I18n.t('devise.confirmations.send_instructions')
  12. else
  13. @show_errors = true
  14. end
  15. end
  16. private
  17. def set_user
  18. @user = current_user
  19. end
  20. def user_params
  21. params.require(:user).permit(:email)
  22. end
  23. end