You've already forked lubo_comment_query
免输入登录功能提交
This commit is contained in:
@ -10,5 +10,25 @@ const webauthn_login = useLogin({
|
||||
optionsUrl: "/login/webauthn/options",
|
||||
})
|
||||
|
||||
window.webauthn_register = webauthn_register
|
||||
window.webauthn_login = webauthn_login
|
||||
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) {
|
||||
e.preventDefault();
|
||||
const formData = new FormData(loginForm)
|
||||
webauthn_login(formData)
|
||||
.then(() => {
|
||||
// 成功登录
|
||||
window.location.href = "/"
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err)
|
||||
alert("登录失败");
|
||||
})
|
||||
return false;
|
||||
})
|
||||
}
|
||||
})()
|
||||
|
Reference in New Issue
Block a user