tweak
This commit is contained in:
parent
6ce0b8d10b
commit
df6c006515
|
|
@ -54,9 +54,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
throw new Error('not verified');
|
throw new Error('not verified');
|
||||||
}
|
}
|
||||||
|
|
||||||
const backupCodes = Array.from({ length: 20 }, () => {
|
const backupCodes = Array.from({ length: 5 }, () => new OTPAuth.Secret().base32);
|
||||||
return new OTPAuth.Secret().base32;
|
|
||||||
});
|
|
||||||
|
|
||||||
await this.userProfilesRepository.update(me.id, {
|
await this.userProfilesRepository.update(me.id, {
|
||||||
twoFactorSecret: profile.twoFactorTempSecret,
|
twoFactorSecret: profile.twoFactorTempSecret,
|
||||||
|
|
|
||||||
|
|
@ -33,10 +33,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
<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>
|
||||||
</template>
|
</template>
|
||||||
</I18n>
|
</I18n>
|
||||||
<div>
|
<div>{{ i18n.ts._2fa.step2 }}<br>{{ i18n.ts._2fa.step2Click }}</div>
|
||||||
{{ i18n.ts._2fa.step2 }}<br>
|
|
||||||
{{ i18n.ts._2fa.step2Click }}
|
|
||||||
</div>
|
|
||||||
<a :href="twoFactorData.url"><img :class="$style.qr" :src="twoFactorData.qr"></a>
|
<a :href="twoFactorData.url"><img :class="$style.qr" :src="twoFactorData.qr"></a>
|
||||||
<MkKeyValue :copy="twoFactorData.url">
|
<MkKeyValue :copy="twoFactorData.url">
|
||||||
<template #key>{{ i18n.ts._2fa.step2Uri }}</template>
|
<template #key>{{ i18n.ts._2fa.step2Uri }}</template>
|
||||||
|
|
@ -80,9 +77,12 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
<div class="_gaps">
|
<div class="_gaps">
|
||||||
<MkInfo warn>{{ i18n.ts._2fa.backupCodesDescription }}</MkInfo>
|
<MkInfo warn>{{ i18n.ts._2fa.backupCodesDescription }}</MkInfo>
|
||||||
|
|
||||||
<ul v-for="code in backupCodes" :key="code" class="_gaps_s" style="margin: 0;">
|
<div v-for="(code, i) in backupCodes" :key="code" class="_gaps_s">
|
||||||
<li class="_monospace">{{ code }}</li>
|
<MkKeyValue :copy="code">
|
||||||
</ul>
|
<template #key>#{{ i + 1 }}</template>
|
||||||
|
<template #value><code class="_monospace">{{ code }}</code></template>
|
||||||
|
</MkKeyValue>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</MkFolder>
|
</MkFolder>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue