mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-12 02:45:49 +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)
|
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 cookies = useCookies(['nginx-ui-2fa'])
|
||||||
const ssid = cookies.get('secure_session_id')
|
const ssid = cookies.get('secure_session_id')
|
||||||
if (ssid) {
|
if (ssid) {
|
||||||
|
|
|
@ -55,6 +55,8 @@ function removeBannedIP(ip: string) {
|
||||||
<template>
|
<template>
|
||||||
<div class="flex justify-center">
|
<div class="flex justify-center">
|
||||||
<div>
|
<div>
|
||||||
|
<TOTP class="mb-4" />
|
||||||
|
|
||||||
<AAlert
|
<AAlert
|
||||||
class="mb-4"
|
class="mb-4"
|
||||||
:message="$gettext('Tips')"
|
:message="$gettext('Tips')"
|
||||||
|
@ -106,8 +108,6 @@ function removeBannedIP(ip: string) {
|
||||||
</template>
|
</template>
|
||||||
</ATable>
|
</ATable>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<TOTP />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue