mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-13 04:06:54 +00:00
feat: Increase access token length
Reviewed-By: ginger <ginger@gingershaped.computer>
This commit is contained in:
1 file changed
+2
-2
@@ -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) })
|
||||
|
||||
Reference in new issue
Block a user