Skip to content
This repository has been archived by the owner on Sep 10, 2024. It is now read-only.

Commit

Permalink
Remove the old password change page (#2874)
Browse files Browse the repository at this point in the history
  • Loading branch information
reivilibre authored Jun 27, 2024
1 parent aaa7cf3 commit 7c67630
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 270 deletions.
6 changes: 1 addition & 5 deletions crates/handlers/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ where
.route(
mas_router::ChangePasswordDiscovery::route(),
get(|State(url_builder): State<UrlBuilder>| async move {
url_builder.redirect(&mas_router::AccountPassword)
url_builder.redirect(&mas_router::AccountPasswordChange)
}),
)
.route(mas_router::Index::route(), get(self::views::index::get))
Expand All @@ -371,10 +371,6 @@ where
mas_router::Register::route(),
get(self::views::register::get).post(self::views::register::post),
)
.route(
mas_router::AccountPassword::route(),
get(self::views::account::password::get).post(self::views::account::password::post),
)
.route(
mas_router::AccountVerifyEmail::route(),
get(self::views::account::emails::verify::get)
Expand Down
1 change: 0 additions & 1 deletion crates/handlers/src/views/account/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,3 @@
// limitations under the License.

pub mod emails;
pub mod password;
198 changes: 0 additions & 198 deletions crates/handlers/src/views/account/password.rs

This file was deleted.

13 changes: 8 additions & 5 deletions crates/router/src/endpoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ impl PostAuthAction {
Self::ContinueCompatSsoLogin { id } => {
url_builder.redirect(&CompatLoginSsoComplete::new(*id, None))
}
Self::ChangePassword => url_builder.redirect(&AccountPassword),
Self::ChangePassword => url_builder.redirect(&AccountPasswordChange),
Self::LinkUpstream { id } => url_builder.redirect(&UpstreamOAuth2Link::new(*id)),
Self::ManageAccount { action } => url_builder.redirect(&Account {
action: action.clone(),
Expand Down Expand Up @@ -506,12 +506,15 @@ impl SimpleRoute for AccountWildcard {
const PATH: &'static str = "/account/*rest";
}

/// `GET|POST /change-password`
/// `GET /account/password/change`
///
/// Handled by the React frontend; this struct definition is purely for
/// redirects.
#[derive(Default, Debug, Clone)]
pub struct AccountPassword;
pub struct AccountPasswordChange;

impl SimpleRoute for AccountPassword {
const PATH: &'static str = "/change-password";
impl SimpleRoute for AccountPasswordChange {
const PATH: &'static str = "/account/password/change";
}

/// `GET /authorize/:grant_id`
Expand Down
4 changes: 0 additions & 4 deletions crates/templates/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,6 @@ register_templates! {
/// Render the home page
pub fn render_index(WithLanguage<WithCsrf<WithOptionalSession<IndexContext>>>) { "pages/index.html" }

/// Render the password change page
pub fn render_account_password(WithLanguage<WithCsrf<WithSession<EmptyContext>>>) { "pages/account/password.html" }

/// Render the email verification page
pub fn render_account_verify_email(WithLanguage<WithCsrf<WithSession<EmailVerificationPageContext>>>) { "pages/account/emails/verify.html" }

Expand Down Expand Up @@ -404,7 +401,6 @@ impl Templates {
check::render_policy_violation(self, now, rng)?;
check::render_sso_login(self, now, rng)?;
check::render_index(self, now, rng)?;
check::render_account_password(self, now, rng)?;
check::render_account_add_email(self, now, rng)?;
check::render_account_verify_email(self, now, rng)?;
check::render_reauth(self, now, rng)?;
Expand Down
49 changes: 0 additions & 49 deletions templates/pages/account/password.html

This file was deleted.

9 changes: 1 addition & 8 deletions translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,31 +118,24 @@
"change_password": {
"change": "Change password",
"@change": {
"context": "pages/account/password.html:46:26-57",
"description": "Button to change the user's password"
},
"confirm": "Confirm password",
"@confirm": {
"context": "pages/account/password.html:42:33-65",
"description": "Confirmation field for the new password"
},
"current": "Current password",
"@current": {
"context": "pages/account/password.html:34:33-65",
"description": "Field for the user's current password"
},
"description": "This will change the password on your account.",
"@description": {
"context": "pages/account/password.html:27:25-61"
},
"@description": {},
"heading": "Change my password",
"@heading": {
"context": "pages/account/password.html:26:27-59",
"description": "Heading on the change password page"
},
"new": "New password",
"@new": {
"context": "pages/account/password.html:38:33-61",
"description": "Field for the user's new password"
}
},
Expand Down

0 comments on commit 7c67630

Please sign in to comment.