]> cat aescling's git repositories - mastodon.git/blob - app/controllers/auth/passwords_controller.rb
Merge branch 'master' into glitch-soc/merge-upstream
[mastodon.git] / app / controllers / auth / passwords_controller.rb
1 # frozen_string_literal: true
2
3 class Auth::PasswordsController < Devise::PasswordsController
4 before_action :check_validity_of_reset_password_token, only: :edit
5 before_action :set_pack
6 before_action :set_body_classes
7
8 layout 'auth'
9
10 private
11
12 def check_validity_of_reset_password_token
13 unless reset_password_token_is_valid?
14 flash[:error] = I18n.t('auth.invalid_reset_password_token')
15 redirect_to new_password_path(resource_name)
16 end
17 end
18
19 def set_body_classes
20 @body_classes = 'lighter'
21 end
22
23 def reset_password_token_is_valid?
24 resource_class.with_reset_password_token(params[:reset_password_token]).present?
25 end
26
27 def set_pack
28 use_pack 'auth'
29 end
30 end
This page took 0.07419 seconds and 4 git commands to generate.