mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 02:15:48 +02:00
fix: do not popup otp modal if user not enable 2fa
This commit is contained in:
parent
b68e8a1403
commit
afd6bf4268
2 changed files with 10 additions and 3 deletions
|
@ -24,7 +24,14 @@ const useOTPModal = () => {
|
|||
document.head.appendChild(style)
|
||||
}
|
||||
|
||||
const open = ({ onOk, onCancel }: OTPModalProps) => {
|
||||
const open = async ({ onOk, onCancel }: OTPModalProps) => {
|
||||
const { status } = await otp.status()
|
||||
if (!status) {
|
||||
onOk?.('')
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
const cookies = useCookies(['nginx-ui-2fa'])
|
||||
const ssid = cookies.get('secure_session_id')
|
||||
if (ssid) {
|
||||
|
|
|
@ -55,6 +55,8 @@ function removeBannedIP(ip: string) {
|
|||
<template>
|
||||
<div class="flex justify-center">
|
||||
<div>
|
||||
<TOTP class="mb-4" />
|
||||
|
||||
<AAlert
|
||||
class="mb-4"
|
||||
:message="$gettext('Tips')"
|
||||
|
@ -106,8 +108,6 @@ function removeBannedIP(ip: string) {
|
|||
</template>
|
||||
</ATable>
|
||||
</div>
|
||||
|
||||
<TOTP />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue