mirror of
https://github.com/mastodon/mastodon.git
synced 2025-09-05 17:31:12 +00:00
Method to check accept token value
This commit is contained in:
parent
84f5bb5ac0
commit
0d5a72aef5
|
@ -130,7 +130,7 @@ class Auth::RegistrationsController < Devise::RegistrationsController
|
|||
end
|
||||
|
||||
def require_rules_acceptance!
|
||||
return if @rules.empty? || (session[:accept_token].present? && params[:accept] == session[:accept_token])
|
||||
return if @rules.empty? || validated_accept_token?
|
||||
|
||||
@accept_token = session[:accept_token] = SecureRandom.hex
|
||||
@invite_code = invite_code
|
||||
|
@ -139,6 +139,10 @@ class Auth::RegistrationsController < Devise::RegistrationsController
|
|||
render :rules
|
||||
end
|
||||
|
||||
def validated_accept_token?
|
||||
session[:accept_token].present? && params[:accept] == session[:accept_token]
|
||||
end
|
||||
|
||||
def is_flashing_format? # rubocop:disable Naming/PredicatePrefix
|
||||
if params[:action] == 'create'
|
||||
false # Disable flash messages for sign-up
|
||||
|
|
Loading…
Reference in New Issue
Block a user