feat: Increase access token length

Reviewed-By: ginger <ginger@gingershaped.computer>
This commit is contained in:
timedout committed 2026-07-19 15:06:23 +01:00
1 parent 153ef3a173
commit 8b3be67860
1 file changed
+2 -2
+2 -2
View File
@@ -25,11 +25,11 @@ pub struct DeviceToken {
}
impl DeviceToken {
const DEVICE_ID_LENGTH: usize = 10;
const ACCESS_TOKEN_LENGTH: usize = 24;
pub fn new(token: String) -> Self { Self { token, max_age: None } }
pub fn new_random() -> Self { Self::new(utils::random_string(Self::DEVICE_ID_LENGTH)) }
pub fn new_random() -> Self { Self::new(utils::random_string(Self::ACCESS_TOKEN_LENGTH)) }
pub fn with_max_age(self, max_age: Duration) -> Self {
assign!(self, { max_age: Some(max_age) })