reset/update password
ci/woodpecker/push/e2e Pipeline was successful
ci/woodpecker/push/fmt Pipeline failed
ci/woodpecker/push/test Pipeline was successful

This commit is contained in:
2026-08-03 11:33:24 -04:00
parent 3160a898be
commit a6482ddb0e
7 changed files with 133 additions and 1 deletions
+27 -1
View File
@@ -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" {}
},