feat(auth): implement user and device authentication
This commit is contained in:
@@ -9,6 +9,19 @@
|
||||
if (summary) summary.focus();
|
||||
}
|
||||
|
||||
const passwordToggle = document.querySelector("[data-password-toggle]");
|
||||
if (passwordToggle) {
|
||||
const password = document.getElementById(
|
||||
passwordToggle.getAttribute("aria-controls"),
|
||||
);
|
||||
passwordToggle.addEventListener("click", () => {
|
||||
const showing = password.type === "text";
|
||||
password.type = showing ? "password" : "text";
|
||||
passwordToggle.textContent = showing ? "显示" : "隐藏";
|
||||
passwordToggle.setAttribute("aria-pressed", String(!showing));
|
||||
});
|
||||
}
|
||||
|
||||
document.querySelectorAll("[data-loading-form]").forEach((form) => {
|
||||
form.addEventListener("submit", () => {
|
||||
form.setAttribute("aria-busy", "true");
|
||||
|
||||
Reference in New Issue
Block a user