Spiegel von
https://github.com/dani-garcia/vaultwarden.git
synchronisiert 2024-11-16 04:12:53 +01:00
Stop rolling device token
Dieser Commit ist enthalten in:
Ursprung
a90817e914
Commit
44e738b981
2 geänderte Dateien mit 1 neuen und 6 gelöschten Zeilen
|
@ -1074,8 +1074,7 @@ pub async fn refresh_tokens(refresh_token: &str, conn: &mut DbConn) -> ApiResult
|
||||||
Some(device) => device,
|
Some(device) => device,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Roll the Device.refresh_token this way it invalides old JWT refresh_token
|
// Save to update `updated_at`.
|
||||||
device.roll_refresh_token();
|
|
||||||
device.save(conn).await?;
|
device.save(conn).await?;
|
||||||
|
|
||||||
let user = match User::find_by_uuid(&device.user_uuid, conn).await {
|
let user = match User::find_by_uuid(&device.user_uuid, conn).await {
|
||||||
|
|
|
@ -48,10 +48,6 @@ impl Device {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn roll_refresh_token(&mut self) {
|
|
||||||
self.refresh_token = crypto::encode_random_bytes::<64>(BASE64URL)
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn refresh_twofactor_remember(&mut self) -> String {
|
pub fn refresh_twofactor_remember(&mut self) -> String {
|
||||||
let twofactor_remember = crypto::encode_random_bytes::<180>(BASE64);
|
let twofactor_remember = crypto::encode_random_bytes::<180>(BASE64);
|
||||||
self.twofactor_remember = Some(twofactor_remember.clone());
|
self.twofactor_remember = Some(twofactor_remember.clone());
|
||||||
|
|
Laden …
In neuem Issue referenzieren