mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-02-20 09:11:58 -07:00
make formatting check happy
This commit is contained in:
parent
0844f57ba8
commit
7b889e57a8
13
src/auth.rs
13
src/auth.rs
@ -1175,9 +1175,14 @@ impl AuthTokens {
|
||||
}
|
||||
|
||||
// Create refresh_token and access_token with default validity
|
||||
pub fn new(device: &Device, user: &User, sub: AuthMethod, client_id: Option<String>, existing_refresh_claims: Option<&RefreshJwtClaims>) -> Self {
|
||||
pub fn new(
|
||||
device: &Device,
|
||||
user: &User,
|
||||
sub: AuthMethod,
|
||||
client_id: Option<String>,
|
||||
existing_refresh_claims: Option<&RefreshJwtClaims>,
|
||||
) -> Self {
|
||||
let time_now = Utc::now();
|
||||
|
||||
let access_claims = LoginJwtClaims::default(device, user, &sub, client_id);
|
||||
|
||||
let validity = if device.is_mobile() {
|
||||
@ -1258,7 +1263,9 @@ pub async fn refresh_tokens(
|
||||
}
|
||||
AuthMethod::Sso => err!("SSO is now disabled, Login again using email and master password"),
|
||||
AuthMethod::Password if CONFIG.sso_enabled() && CONFIG.sso_only() => err!("SSO is now required, Login again"),
|
||||
AuthMethod::Password => AuthTokens::new(&device, &user, refresh_claims.sub.clone(), client_id, Some(&refresh_claims)),
|
||||
AuthMethod::Password => {
|
||||
AuthTokens::new(&device, &user, refresh_claims.sub.clone(), client_id, Some(&refresh_claims))
|
||||
}
|
||||
_ => err!("Invalid auth method, cannot refresh token"),
|
||||
};
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user