diff options
Diffstat (limited to 'src/api/auth/account.rs')
-rw-r--r-- | src/api/auth/account.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/api/auth/account.rs b/src/api/auth/account.rs index 56ec717..9d2a19e 100644 --- a/src/api/auth/account.rs +++ b/src/api/auth/account.rs @@ -11,7 +11,7 @@ use serde::{Deserialize, Serialize}; use validator::Validate; use crate::api::{Empty, EMPTY}; -use crate::crypto::{KeyFetchToken, SessionToken}; +use crate::crypto::{random_bytes, KeyFetchToken, SessionToken}; use crate::db::{Db, DbConn}; use crate::mailer::Mailer; use crate::push::PushClient; @@ -21,7 +21,7 @@ use crate::Config; use crate::{ api::{auth, serialize_dt}, auth::{AuthSource, Authenticated}, - crypto::{AuthPW, KeyBundle, KeyFetchReq, SecretBytes, SessionCredentials}, + crypto::{AuthPW, KeyBundle, KeyFetchReq, SessionCredentials}, types::{KeyFetchID, OauthToken, SecretKey, User, UserID, VerifyHash}, }; @@ -122,7 +122,7 @@ pub(crate) async fn create( .await?; let auth_at = db.add_session(session.token_id.clone(), &uid, session.req_hmac_key, false, None).await?; - let verify_code = hex::encode(&SecretBytes::<16>::generate().0); + let verify_code = hex::encode(&random_bytes::<16>()); db.add_verify_code(&uid, &session.token_id, &verify_code).await?; // NOTE we send the email in this context rather than a spawn to signal // send errors to the client. |