diff --git a/trifid-api/src/routes/v1/totp_authenticators.rs b/trifid-api/src/routes/v1/totp_authenticators.rs index a24e66b..955d02b 100644 --- a/trifid-api/src/routes/v1/totp_authenticators.rs +++ b/trifid-api/src/routes/v1/totp_authenticators.rs @@ -10,7 +10,7 @@ use crate::error::{APIError, APIErrorsResponse}; use trifid_api_entities::entity::totp_authenticator; use crate::config::CONFIG; use crate::timers::expires_in_seconds; -use crate::tokens::random_id; +use crate::tokens::{random_id, random_token}; #[derive(Serialize, Deserialize, Debug, Clone)] pub struct TotpAuthenticatorsRequest {} @@ -119,7 +119,7 @@ pub async fn totp_authenticators_request(db: Data, req_data: HttpReque }; let model = totp_authenticator::Model { - id: random_id("totp"), + id: random_token("totp"), secret: Secret::Raw(totpmachine.secret.clone()).to_encoded().to_string(), url: totpmachine.get_url(), verified: false,