mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-06 02:48:43 +00:00
fix: correct property name for TOTP enabled flag in parseTotpEnabled function
This commit is contained in:
@@ -2,7 +2,7 @@ export function parseTotpEnabled(tokenValue: string | null) {
|
|||||||
if (!tokenValue) return false;
|
if (!tokenValue) return false;
|
||||||
try {
|
try {
|
||||||
const payload = JSON.parse(atob(tokenValue.split('.')[1]));
|
const payload = JSON.parse(atob(tokenValue.split('.')[1]));
|
||||||
const flag = payload?.totp;
|
const flag = payload?.totp_enabled;
|
||||||
if (typeof flag === 'string') return flag.toLowerCase() === 'true';
|
if (typeof flag === 'string') return flag.toLowerCase() === 'true';
|
||||||
return Boolean(flag);
|
return Boolean(flag);
|
||||||
} catch {
|
} catch {
|
||||||
|
|||||||
Reference in New Issue
Block a user