mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
ui: fix signin dialog
This commit is contained in:
3 files changed
+7
-15
No files matched your search
@@ -1,8 +0,0 @@
|
||||
const { writeFileSync } = require('fs');
|
||||
const argv = require('cac')().parse();
|
||||
const pkg = require('../package.json');
|
||||
|
||||
if (argv.options.dev) pkg.version = `${pkg.version}-dev`;
|
||||
else pkg.version = pkg.version.replace('-dev', '');
|
||||
|
||||
writeFileSync(`${process.cwd()}/package.json`, JSON.stringify(pkg, null, 2));
|
||||
@@ -42,7 +42,7 @@ const signinDialogPage = new AutoloadPage('signinDialogPage', null, () => {
|
||||
$('[data-lostpass]').on('click', (e) => {
|
||||
e.preventDefault();
|
||||
new InfoDialog({
|
||||
$body: tpl`<p>${i18n('Relax and try to remember your password.')}</p>`,
|
||||
$body: tpl.typoMsg(i18n('Relax and try to remember your password.')),
|
||||
}).open();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -72,8 +72,8 @@ async function chooseAction(authn?: boolean) {
|
||||
export default new AutoloadPage('user_verify', () => {
|
||||
$(document).on('click', '[name="login_submit"]', async (ev) => {
|
||||
ev.preventDefault();
|
||||
const $form = ev.currentTarget.form;
|
||||
const uname = $('[name="uname"]').val() as string;
|
||||
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
|
||||
@@ -88,13 +88,13 @@ export default new AutoloadPage('user_verify', () => {
|
||||
let action = (authn && tfa) ? await chooseAction(true) : '';
|
||||
action ||= tfa ? await chooseAction(false) : 'webauthn';
|
||||
if (action === 'webauthn') {
|
||||
const challenge = await verifywebauthn($form);
|
||||
if (challenge) $form['authnChallenge'].value = challenge;
|
||||
const challenge = await verifywebauthn(form);
|
||||
if (challenge) form['authnChallenge'].value = challenge;
|
||||
else return;
|
||||
} else if (action === 'tfa') $form['tfa'].value = $('[name="tfa_code"]').val() as string;
|
||||
} else if (action === 'tfa') form['tfa'].value = $('[name="tfa_code"]').val() as string;
|
||||
else return;
|
||||
}
|
||||
$form.submit();
|
||||
form.submit();
|
||||
});
|
||||
$(document).on('click', '[name=webauthn_verify]', async (ev) => {
|
||||
ev.preventDefault();
|
||||
|
||||
Reference in new issue
Block a user