mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: move tfa check to a seperate route
This commit is contained in:
3 files changed
+15
-14
No files matched your search
@@ -74,19 +74,11 @@ export default new AutoloadPage('user_verify', () => {
|
||||
ev.preventDefault();
|
||||
const form = ev.currentTarget.form;
|
||||
const uname = $(form).find('[name="uname"]').val() as string;
|
||||
const info = await api(gql`
|
||||
uname: user(uname:${uname}){
|
||||
tfa authn
|
||||
}
|
||||
mail: user(mail:${uname}){
|
||||
tfa authn
|
||||
}
|
||||
`, ['data']);
|
||||
if (!info.uname && !info.mail) {
|
||||
Notification.error(i18n('User not found.'));
|
||||
if (!uname) {
|
||||
form.elements.namedItem('uname')?.focus();
|
||||
return;
|
||||
}
|
||||
const { authn, tfa } = info.uname || info.mail;
|
||||
const { authn, tfa } = await request.get('/user/tfa', { q: uname });
|
||||
if (authn || tfa) {
|
||||
const handleKeyDown = (event) => {
|
||||
if (event.key === 'Enter') {
|
||||
|
||||
Reference in new issue
Block a user