1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-08-06 06:02:40 +03:00

Actually send emails for recovery

This commit is contained in:
Quentin Gliech
2024-06-24 17:20:22 +02:00
parent 4a60f5d32f
commit c156a3891e
17 changed files with 337 additions and 14 deletions

View File

@@ -808,6 +808,31 @@ impl Route for AccountRecoveryProgress {
}
}
/// `GET|POST /recover/complete?ticket=:ticket`
#[derive(Default, Serialize, Deserialize, Debug, Clone)]
pub struct AccountRecoveryFinish {
ticket: String,
}
impl AccountRecoveryFinish {
#[must_use]
pub fn new(ticket: String) -> Self {
Self { ticket }
}
}
impl Route for AccountRecoveryFinish {
type Query = AccountRecoveryFinish;
fn route() -> &'static str {
"/recover/complete"
}
fn query(&self) -> Option<&Self::Query> {
Some(self)
}
}
/// `GET /assets`
pub struct StaticAsset {
path: String,

View File

@@ -237,6 +237,12 @@ impl UrlBuilder {
pub fn account_management_uri(&self) -> Url {
self.absolute_url_for(&crate::endpoints::Account::default())
}
/// Account recovery link
#[must_use]
pub fn account_recovery_link(&self, ticket: String) -> Url {
self.absolute_url_for(&crate::endpoints::AccountRecoveryFinish::new(ticket))
}
}
#[cfg(test)]