show/hide password button
This commit is contained in:
+19
-4
@@ -25,13 +25,17 @@ pub fn login_page(error: Option<&str>, invite: Option<&str>) -> Markup {
|
||||
label for="email" { "Email" }
|
||||
input id="email" name="email" type="email" autocomplete="email" autofocus;
|
||||
label for="password" { "Password" }
|
||||
input id="password" name="password" type="password" autocomplete="current-password" required;
|
||||
div class="password-field" {
|
||||
input id="password" name="password" type="password" autocomplete="current-password" required;
|
||||
button class="password-toggle" type="button" data-toggle-for="password" aria-label="Show password" { "Show" }
|
||||
}
|
||||
button class="button button-primary" type="submit" { "Sign in" }
|
||||
}
|
||||
div class="auth-divider" { span { "or" } }
|
||||
button id="passkey-login" class="button button-secondary" type="button" { "Sign in with a passkey" }
|
||||
p class="auth-switch" { "Need an account? " a href="/register" { "Create one" } }
|
||||
}
|
||||
script src="/static/password-toggle.js" {}
|
||||
script src="/static/passkey-login.js" {}
|
||||
},
|
||||
)
|
||||
@@ -58,11 +62,15 @@ pub fn register_page(error: Option<&str>, invite: Option<&str>) -> Markup {
|
||||
label for="email" { "Email" }
|
||||
input id="email" name="email" type="email" autocomplete="email" required;
|
||||
label for="password" { "Password" }
|
||||
input id="password" name="password" type="password" autocomplete="new-password" required;
|
||||
div class="password-field" {
|
||||
input id="password" name="password" type="password" autocomplete="new-password" required;
|
||||
button class="password-toggle" type="button" data-toggle-for="password" aria-label="Show password" { "Show" }
|
||||
}
|
||||
button class="button button-primary" type="submit" { "Create account" }
|
||||
}
|
||||
p class="auth-switch" { "Already have an account? " a href="/login" { "Sign in" } }
|
||||
}
|
||||
script src="/static/password-toggle.js" {}
|
||||
},
|
||||
)
|
||||
}
|
||||
@@ -141,13 +149,20 @@ pub fn account_page(
|
||||
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;
|
||||
div class="password-field" {
|
||||
input id="new-password" name="new_password" type="password" autocomplete="new-password" required;
|
||||
button class="password-toggle" type="button" data-toggle-for="new-password" aria-label="Show password" { "Show" }
|
||||
}
|
||||
label for="confirm-password" { "Confirm new password" }
|
||||
input id="confirm-password" name="confirm_password" type="password" autocomplete="new-password" required;
|
||||
div class="password-field" {
|
||||
input id="confirm-password" name="confirm_password" type="password" autocomplete="new-password" required;
|
||||
button class="password-toggle" type="button" data-toggle-for="confirm-password" aria-label="Show password" { "Show" }
|
||||
}
|
||||
button class="button button-primary" type="submit" { "Update password" }
|
||||
}
|
||||
}
|
||||
}
|
||||
script src="/static/password-toggle.js" {}
|
||||
script src="/static/passkey-register.js" {}
|
||||
},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user