The code powering m.abunchtell.com https://m.abunchtell.com
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.
 
 
 
 

43 lines
900 B

  1. # frozen_string_literal: true
  2. class Auth::ConfirmationsController < Devise::ConfirmationsController
  3. layout 'auth'
  4. before_action :set_body_classes
  5. before_action :set_user, only: [: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 set_body_classes
  21. @body_classes = 'lighter'
  22. end
  23. def user_params
  24. params.require(:user).permit(:email)
  25. end
  26. def after_confirmation_path_for(_resource_name, user)
  27. if user.created_by_application && truthy_param?(:redirect_to_app)
  28. user.created_by_application.redirect_uri
  29. else
  30. super
  31. end
  32. end
  33. end