and fix that

This commit is contained in:
c0repwn3r 2023-04-02 21:49:45 -04:00
parent 87ddb07d5c
commit 8edd9d2e66
Signed by: core
GPG Key ID: FDBF740DADDCEECF
1 changed files with 2 additions and 2 deletions

View File

@ -10,7 +10,7 @@ use crate::error::{APIError, APIErrorsResponse};
use trifid_api_entities::entity::totp_authenticator; use trifid_api_entities::entity::totp_authenticator;
use crate::config::CONFIG; use crate::config::CONFIG;
use crate::timers::expires_in_seconds; use crate::timers::expires_in_seconds;
use crate::tokens::random_id; use crate::tokens::{random_id, random_token};
#[derive(Serialize, Deserialize, Debug, Clone)] #[derive(Serialize, Deserialize, Debug, Clone)]
pub struct TotpAuthenticatorsRequest {} pub struct TotpAuthenticatorsRequest {}
@ -119,7 +119,7 @@ pub async fn totp_authenticators_request(db: Data<AppState>, req_data: HttpReque
}; };
let model = totp_authenticator::Model { let model = totp_authenticator::Model {
id: random_id("totp"), id: random_token("totp"),
secret: Secret::Raw(totpmachine.secret.clone()).to_encoded().to_string(), secret: Secret::Raw(totpmachine.secret.clone()).to_encoded().to_string(),
url: totpmachine.get_url(), url: totpmachine.get_url(),
verified: false, verified: false,