mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 19:39:30 +08:00
DEV: allow nonce expiry time to be extended cleanly from a plugin
Previously one would have to redefine a constant
This commit is contained in:
@ -24,7 +24,7 @@ class DiscourseSingleSignOn < SingleSignOn
|
|||||||
|
|
||||||
def register_nonce(return_path)
|
def register_nonce(return_path)
|
||||||
if nonce
|
if nonce
|
||||||
$redis.setex(nonce_key, NONCE_EXPIRY_TIME, return_path)
|
$redis.setex(nonce_key, SingleSignOn.nonce_expiry_time, return_path)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -37,7 +37,13 @@ class SingleSignOn
|
|||||||
suppress_welcome_message
|
suppress_welcome_message
|
||||||
}
|
}
|
||||||
|
|
||||||
NONCE_EXPIRY_TIME = 10.minutes
|
def self.nonce_expiry_time
|
||||||
|
@nonce_expiry_time ||= 10.minutes
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.nonce_expiry_time=(v)
|
||||||
|
@nonce_expiry_time = v
|
||||||
|
end
|
||||||
|
|
||||||
attr_accessor(*ACCESSORS)
|
attr_accessor(*ACCESSORS)
|
||||||
attr_writer :sso_secret, :sso_url
|
attr_writer :sso_secret, :sso_url
|
||||||
|
Reference in New Issue
Block a user