mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-06-04 06:24:58 -06:00
Fix: update OAuth2 state storage initialization and state token encoding
This commit is contained in:
parent
96fe363ee5
commit
7e3acf26b4
@ -370,7 +370,7 @@ fn oauth2_authorize(_token: AdminToken) -> Result<Redirect, Error> {
|
|||||||
let scopes = CONFIG.smtp_oauth2_scopes();
|
let scopes = CONFIG.smtp_oauth2_scopes();
|
||||||
|
|
||||||
// Generate a random state token for CSRF protection
|
// Generate a random state token for CSRF protection
|
||||||
let state = crate::crypto::encode_random_bytes::<32>(BASE64URL_NOPAD);
|
let state = crate::crypto::encode_random_bytes::<32>(&BASE64URL_NOPAD);
|
||||||
|
|
||||||
// Store state with expiration (10 minutes from now)
|
// Store state with expiration (10 minutes from now)
|
||||||
let expiration = SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_secs() + 600;
|
let expiration = SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_secs() + 600;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user