mirror of
https://github.com/mastodon/mastodon.git
synced 2025-09-06 09:51:24 +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
|
end
|
||||||
|
|
||||||
def require_rules_acceptance!
|
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
|
@accept_token = session[:accept_token] = SecureRandom.hex
|
||||||
@invite_code = invite_code
|
@invite_code = invite_code
|
||||||
|
@ -139,6 +139,10 @@ class Auth::RegistrationsController < Devise::RegistrationsController
|
||||||
render :rules
|
render :rules
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def validated_accept_token?
|
||||||
|
session[:accept_token].present? && params[:accept] == session[:accept_token]
|
||||||
|
end
|
||||||
|
|
||||||
def is_flashing_format? # rubocop:disable Naming/PredicatePrefix
|
def is_flashing_format? # rubocop:disable Naming/PredicatePrefix
|
||||||
if params[:action] == 'create'
|
if params[:action] == 'create'
|
||||||
false # Disable flash messages for sign-up
|
false # Disable flash messages for sign-up
|
||||||
|
|
Loading…
Reference in New Issue
Block a user