Skip to content

Commit

Permalink
Implement email verification in the registration flow
Browse files Browse the repository at this point in the history
  • Loading branch information
sandhose committed Jan 14, 2025
1 parent 941ab21 commit bda2b00
Show file tree
Hide file tree
Showing 13 changed files with 308 additions and 213 deletions.
6 changes: 3 additions & 3 deletions crates/handlers/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,9 +379,9 @@ where
get(self::views::register::password::get).post(self::views::register::password::post),
)
.route(
mas_router::AccountVerifyEmail::route(),
get(self::views::account::emails::verify::get)
.post(self::views::account::emails::verify::post),
mas_router::RegisterVerifyEmail::route(),
get(self::views::register::steps::verify_email::get)
.post(self::views::register::steps::verify_email::post),
)
.route(
mas_router::AccountRecoveryStart::route(),
Expand Down
7 changes: 0 additions & 7 deletions crates/handlers/src/views/account/emails/mod.rs

This file was deleted.

135 changes: 0 additions & 135 deletions crates/handlers/src/views/account/emails/verify.rs

This file was deleted.

1 change: 0 additions & 1 deletion crates/handlers/src/views/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
// SPDX-License-Identifier: AGPL-3.0-only
// Please see LICENSE in the repository root for full details.

pub mod account;
pub mod app;
pub mod index;
pub mod login;
Expand Down
1 change: 1 addition & 0 deletions crates/handlers/src/views/register/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ use super::shared::OptionalPostAuthAction;
use crate::{BoundActivityTracker, PreferredLanguage};

pub(crate) mod password;
pub(crate) mod steps;

#[tracing::instrument(name = "handlers.views.register.get", skip_all, err)]
pub(crate) async fn get(
Expand Down
5 changes: 3 additions & 2 deletions crates/handlers/src/views/register/password.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,9 @@ pub(crate) async fn post(

repo.save().await?;

// TODO: redirect to the next step on the registration
Ok(format!("{}", registration.id).into_response())
Ok(url_builder
.redirect(&mas_router::RegisterVerifyEmail::new(registration.id))
.into_response())
}

async fn render(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright 2024 New Vector Ltd.
// Copyright 2021-2024 The Matrix.org Foundation C.I.C.
// Copyright 2025 New Vector Ltd.
//
// SPDX-License-Identifier: AGPL-3.0-only
// Please see LICENSE in the repository root for full details.

pub mod emails;
pub(crate) mod verify_email;
Loading

0 comments on commit bda2b00

Please sign in to comment.