chore: Change password reset page path

This commit is contained in:
Ginger 2026-03-03 13:41:33 -05:00
parent f11943b956
commit 5716c36b47
No known key found for this signature in database
3 changed files with 4 additions and 7 deletions

View file

@ -19,9 +19,8 @@ pub struct ResetTokenInfo {
} }
impl ResetTokenInfo { impl ResetTokenInfo {
const MAX_TOKEN_AGE: Duration = Duration::from_secs(60 * 60);
// one hour // one hour
const MAX_TOKEN_AGE: Duration = Duration::from_secs(60 * 60);
pub fn is_valid(&self) -> bool { pub fn is_valid(&self) -> bool {
let now = SystemTime::now(); let now = SystemTime::now();

View file

@ -8,7 +8,7 @@ use ruma::OwnedUserId;
use crate::{Dep, globals, users}; use crate::{Dep, globals, users};
pub const PASSWORD_RESET_PATH: &str = "/_continuwuity/password_reset"; pub const PASSWORD_RESET_PATH: &str = "/_continuwuity/account/reset_password";
pub const RESET_TOKEN_QUERY_PARAM: &str = "token"; pub const RESET_TOKEN_QUERY_PARAM: &str = "token";
const RESET_TOKEN_LENGTH: usize = 32; const RESET_TOKEN_LENGTH: usize = 32;

View file

@ -6,6 +6,7 @@ use axum::{
response::{Html, IntoResponse, Response}, response::{Html, IntoResponse, Response},
routing::get, routing::get,
}; };
use conduwuit_service::password_reset::PASSWORD_RESET_PATH;
use serde::Deserialize; use serde::Deserialize;
use validator::Validate; use validator::Validate;
@ -53,10 +54,7 @@ form! {
} }
pub(crate) fn build() -> Router<crate::State> { pub(crate) fn build() -> Router<crate::State> {
Router::new().route( Router::new().route(PASSWORD_RESET_PATH, get(get_password_reset).post(post_password_reset))
"/_continuwuity/password_reset",
get(get_password_reset).post(post_password_reset),
)
} }
async fn password_reset_form( async fn password_reset_form(