You've already forked authentication-service
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:
@@ -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,
|
||||
|
@@ -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)]
|
||||
|
Reference in New Issue
Block a user