mirror of
https://iceshrimp.dev/crimekillz/trashposs
synced 2024-11-24 09:49:05 +01:00
fix: 🛂 no longer need 2fa for webauthn
This commit is contained in:
parent
19be92227e
commit
aeba95a8b5
@ -32,9 +32,9 @@ export default define(meta, paramDef, async (ps, user) => {
|
|||||||
throw new Error("incorrect password");
|
throw new Error("incorrect password");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!profile.twoFactorEnabled) {
|
// if (!profile.twoFactorEnabled) {
|
||||||
throw new Error("2fa not enabled");
|
// throw new Error("2fa not enabled");
|
||||||
}
|
// }
|
||||||
|
|
||||||
// 32 byte challenge
|
// 32 byte challenge
|
||||||
const entropy = await randomBytes(32);
|
const entropy = await randomBytes(32);
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
<MkLoading v-else-if="type === 'waiting'" :class="$style.iconInner" :em="true"/>
|
<MkLoading v-else-if="type === 'waiting'" :class="$style.iconInner" :em="true"/>
|
||||||
</div>
|
</div>
|
||||||
<header v-if="title" :class="$style.title"><Mfm :text="title"/></header>
|
<header v-if="title" :class="$style.title"><Mfm :text="title"/></header>
|
||||||
|
<header v-if="title == null && input.type === 'password'" :class="$style.title"><Mfm :text="i18n.ts.password"/></header>
|
||||||
<div v-if="text" :class="$style.text"><Mfm :text="text"/></div>
|
<div v-if="text" :class="$style.text"><Mfm :text="text"/></div>
|
||||||
<MkInput v-if="input && input.type !== 'paragraph'" v-model="inputValue" autofocus :type="input.type || 'text'" :placeholder="input.placeholder || undefined" @keydown="onInputKeydown">
|
<MkInput v-if="input && input.type !== 'paragraph'" v-model="inputValue" autofocus :type="input.type || 'text'" :placeholder="input.placeholder || undefined" @keydown="onInputKeydown">
|
||||||
<template v-if="input.type === 'password'" #prefix><i class="ph-password ph-bold ph-lg"></i></template>
|
<template v-if="input.type === 'password'" #prefix><i class="ph-password ph-bold ph-lg"></i></template>
|
||||||
|
@ -4,7 +4,9 @@
|
|||||||
<template v-if="$i.twoFactorEnabled">
|
<template v-if="$i.twoFactorEnabled">
|
||||||
<p>{{ i18n.ts._2fa.alreadyRegistered }}</p>
|
<p>{{ i18n.ts._2fa.alreadyRegistered }}</p>
|
||||||
<MkButton @click="unregister">{{ i18n.ts.unregister }}</MkButton>
|
<MkButton @click="unregister">{{ i18n.ts.unregister }}</MkButton>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template>
|
||||||
<template v-if="supportsCredentials">
|
<template v-if="supportsCredentials">
|
||||||
<hr class="totp-method-sep">
|
<hr class="totp-method-sep">
|
||||||
|
|
||||||
@ -20,7 +22,7 @@
|
|||||||
|
|
||||||
<MkSwitch v-if="$i.securityKeysList.length > 0" v-model="usePasswordLessLogin" @update:modelValue="updatePasswordLessLogin">{{ i18n.ts.passwordLessLogin }}</MkSwitch>
|
<MkSwitch v-if="$i.securityKeysList.length > 0" v-model="usePasswordLessLogin" @update:modelValue="updatePasswordLessLogin">{{ i18n.ts.passwordLessLogin }}</MkSwitch>
|
||||||
|
|
||||||
<MkInfo v-if="registration && registration.error" warn>{{ i18n.ts.error }} {{ registration.error }}</MkInfo>
|
<MkInfo v-if="registration && registration.error" style="margin-bottom: 1rem;" warn>{{ i18n.ts.error }}: {{ registration.error }}</MkInfo>
|
||||||
<MkButton v-if="!registration || registration.error" @click="addSecurityKey">{{ i18n.ts._2fa.registerKey }}</MkButton>
|
<MkButton v-if="!registration || registration.error" @click="addSecurityKey">{{ i18n.ts._2fa.registerKey }}</MkButton>
|
||||||
|
|
||||||
<ol v-if="registration && !registration.error">
|
<ol v-if="registration && !registration.error">
|
||||||
@ -45,7 +47,7 @@
|
|||||||
<li>
|
<li>
|
||||||
<I18n :src="i18n.ts._2fa.step1" tag="span">
|
<I18n :src="i18n.ts._2fa.step1" tag="span">
|
||||||
<template #a>
|
<template #a>
|
||||||
<a href="https://authy.com/" rel="noopener" target="_blank" class="_link">Authy</a>
|
<a href="https://authpass.app/" rel="noopener" target="_blank" class="_link">AuthPass</a>
|
||||||
</template>
|
</template>
|
||||||
<template #b>
|
<template #b>
|
||||||
<a href="https://support.google.com/accounts/answer/1066447" rel="noopener" target="_blank" class="_link">Google Authenticator</a>
|
<a href="https://support.google.com/accounts/answer/1066447" rel="noopener" target="_blank" class="_link">Google Authenticator</a>
|
||||||
@ -140,7 +142,7 @@ function registerKey() {
|
|||||||
attestationObject: hexify(registration.value.credential.response.attestationObject)
|
attestationObject: hexify(registration.value.credential.response.attestationObject)
|
||||||
}).then(key => {
|
}).then(key => {
|
||||||
registration.value = null;
|
registration.value = null;
|
||||||
key.lastUsed = new Date();
|
key!.lastUsed = new Date();
|
||||||
os.success();
|
os.success();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user