You've already forked lubo_comment_query
webauthn登录逻辑调整
This commit is contained in:
@ -13,13 +13,16 @@ const webauthn_login = useLogin({
|
||||
window.webauthn_register = webauthn_register;
|
||||
window.webauthn_login = webauthn_login;
|
||||
(function() {
|
||||
const loginForm = window.document.getElementById("webauthn_login_form");
|
||||
console.log(loginForm)
|
||||
if (loginForm) {
|
||||
loginForm.addEventListener("submit", function (e) {
|
||||
const button = window.document.getElementById("do_webauthn_login");
|
||||
if (button) {
|
||||
button.addEventListener("click", function (e) {
|
||||
const loginForm = window.document.getElementById("webauthn_login_form");
|
||||
if (!loginForm) return;
|
||||
e.preventDefault();
|
||||
const formData = new FormData(loginForm)
|
||||
webauthn_login(formData)
|
||||
webauthn_login({
|
||||
username: formData.get("username")
|
||||
})
|
||||
.then(() => {
|
||||
// 成功登录
|
||||
window.location.href = "/"
|
||||
|
Reference in New Issue
Block a user