1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-07-29 22:01:14 +03:00

Switch email verification to a code-based flow

This commit is contained in:
Quentin Gliech
2022-05-24 12:31:05 +02:00
parent 35fa7c732a
commit 89597dbf81
18 changed files with 409 additions and 236 deletions

View File

@ -173,6 +173,7 @@ pub enum UserEmailVerificationState {
pub struct UserEmailVerification<T: StorageBackend> {
pub data: T::UserEmailVerificationData,
pub email: UserEmail<T>,
pub code: String,
pub created_at: DateTime<Utc>,
pub state: UserEmailVerificationState,
}
@ -182,6 +183,7 @@ impl<S: StorageBackendMarker> From<UserEmailVerification<S>> for UserEmailVerifi
Self {
data: (),
email: v.email.into(),
code: v.code,
created_at: v.created_at,
state: v.state,
}
@ -207,6 +209,7 @@ where
.flat_map(|state| {
UserEmail::samples().into_iter().map(move |email| Self {
data: Default::default(),
code: "123456".to_string(),
email,
created_at: Utc::now() - Duration::minutes(10),
state: state.clone(),