logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe git clone https://hacktivis.me/git/mastofe.git

confirmations_controller.rb (642B)


  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. sign_in(@user, bypass: true)
  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