]> cat aescling's git repositories - mastodon.git/blob - app/controllers/auth/confirmations_controller.rb
Merge branch 'master' into glitch-soc/merge-upstream
[mastodon.git] / app / controllers / auth / confirmations_controller.rb
1 # frozen_string_literal: true
2
3 class Auth::ConfirmationsController < Devise::ConfirmationsController
4 layout 'auth'
5
6 before_action :set_body_classes
7 before_action :set_user, only: [:finish_signup]
8 before_action :set_pack
9
10 # GET/PATCH /users/:id/finish_signup
11 def finish_signup
12 return unless request.patch? && params[:user]
13 if @user.update(user_params)
14 @user.skip_reconfirmation!
15 bypass_sign_in(@user)
16 redirect_to root_path, notice: I18n.t('devise.confirmations.send_instructions')
17 else
18 @show_errors = true
19 end
20 end
21
22 private
23
24 def set_pack
25 use_pack 'auth'
26 end
27
28 def set_user
29 @user = current_user
30 end
31
32 def set_body_classes
33 @body_classes = 'lighter'
34 end
35
36 def user_params
37 params.require(:user).permit(:email)
38 end
39 end
This page took 0.074691 seconds and 4 git commands to generate.