reset/update password
This commit is contained in:
+27
-1
@@ -82,7 +82,13 @@ pub fn registration_closed_page() -> Markup {
|
||||
)
|
||||
}
|
||||
|
||||
pub fn account_page(user: &User, passkeys: &[Passkey], csrf_token: &str) -> Markup {
|
||||
pub fn account_page(
|
||||
user: &User,
|
||||
passkeys: &[Passkey],
|
||||
csrf_token: &str,
|
||||
password_error: Option<&str>,
|
||||
password_success: bool,
|
||||
) -> Markup {
|
||||
page(
|
||||
"Account",
|
||||
Some(user),
|
||||
@@ -121,6 +127,26 @@ pub fn account_page(user: &User, passkeys: &[Passkey], csrf_token: &str) -> Mark
|
||||
}
|
||||
button id="add-passkey" class="button button-primary" type="button" data-csrf=(csrf_token) { "Add a passkey" }
|
||||
}
|
||||
section class="panel" {
|
||||
div class="panel-heading" {
|
||||
h2 { "Password" }
|
||||
}
|
||||
p { "Set a new password for your account." }
|
||||
@if let Some(error) = password_error {
|
||||
div class="alert alert-error" role="alert" { (error) }
|
||||
}
|
||||
@if password_success {
|
||||
div class="alert alert-success" role="alert" { "Your password has been updated." }
|
||||
}
|
||||
form method="post" action="/account/password" class="stack" {
|
||||
input type="hidden" name="csrf" value=(csrf_token);
|
||||
label for="new-password" { "New password" }
|
||||
input id="new-password" name="new_password" type="password" autocomplete="new-password" required;
|
||||
label for="confirm-password" { "Confirm new password" }
|
||||
input id="confirm-password" name="confirm_password" type="password" autocomplete="new-password" required;
|
||||
button class="button button-primary" type="submit" { "Update password" }
|
||||
}
|
||||
}
|
||||
}
|
||||
script src="/static/passkey-register.js" {}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user