and fix that
This commit is contained in:
parent
87ddb07d5c
commit
8edd9d2e66
|
@ -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,
|
||||||
|
|
Loading…
Reference in New Issue