Stefan Melmuk
5 days ago
No known key found for this signature in database
GPG Key ID: 817020C608FE9C09
2 changed files with
5 additions and
5 deletions
-
src/auth.rs
-
src/db/models/device.rs
|
@ -1174,7 +1174,7 @@ impl AuthTokens { |
|
|
|
|
|
|
|
|
let access_claims = LoginJwtClaims::default(device, user, &sub, client_id); |
|
|
let access_claims = LoginJwtClaims::default(device, user, &sub, client_id); |
|
|
|
|
|
|
|
|
let validity = if DeviceType::is_mobile(&device.atype) { |
|
|
let validity = if device.is_mobile() { |
|
|
*MOBILE_REFRESH_VALIDITY |
|
|
*MOBILE_REFRESH_VALIDITY |
|
|
} else { |
|
|
} else { |
|
|
*DEFAULT_REFRESH_VALIDITY |
|
|
*DEFAULT_REFRESH_VALIDITY |
|
|
|
@ -70,6 +70,10 @@ impl Device { |
|
|
pub fn is_cli(&self) -> bool { |
|
|
pub fn is_cli(&self) -> bool { |
|
|
matches!(DeviceType::from_i32(self.atype), DeviceType::WindowsCLI | DeviceType::MacOsCLI | DeviceType::LinuxCLI) |
|
|
matches!(DeviceType::from_i32(self.atype), DeviceType::WindowsCLI | DeviceType::MacOsCLI | DeviceType::LinuxCLI) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
pub fn is_mobile(&self) -> bool { |
|
|
|
|
|
matches!(DeviceType::from_i32(self.atype), DeviceType::Android | DeviceType::Ios) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
pub struct DeviceWithAuthRequest { |
|
|
pub struct DeviceWithAuthRequest { |
|
@ -353,10 +357,6 @@ impl DeviceType { |
|
|
_ => DeviceType::UnknownBrowser, |
|
|
_ => DeviceType::UnknownBrowser, |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
pub fn is_mobile(value: &i32) -> bool { |
|
|
|
|
|
*value == DeviceType::Android as i32 || *value == DeviceType::Ios as i32 |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
#[derive(
|
|
|
#[derive(
|
|
|