mirror of
https://github.com/HeyPuter/puter.git
synced 2025-01-23 14:20:22 +08:00
fix: only show 2fa when available
This commit is contained in:
parent
6e325fa000
commit
9fa12d43fc
@ -47,7 +47,8 @@ const WHOAMI_GET = eggspress('/whoami', {
|
||||
uuid: req.user.uuid,
|
||||
email: req.user.email,
|
||||
unconfirmed_email: req.user.email,
|
||||
email_confirmed: req.user.email_confirmed,
|
||||
email_confirmed: req.user.email_confirmed
|
||||
|| req.user.username === 'admin',
|
||||
requires_email_confirmation: req.user.requires_email_confirmation,
|
||||
desktop_bg_url: req.user.desktop_bg_url,
|
||||
desktop_bg_color: req.user.desktop_bg_color,
|
||||
@ -168,7 +169,8 @@ WHOAMI_POST.post('/whoami', auth, fs, express.json(), async (req, response, next
|
||||
username: req.user.username,
|
||||
uuid: req.user.uuid,
|
||||
email: req.user.email,
|
||||
email_confirmed: req.user.email_confirmed,
|
||||
email_confirmed: req.user.email_confirmed
|
||||
|| req.user.username === 'admin',
|
||||
requires_email_confirmation: req.user.requires_email_confirmation,
|
||||
desktop_bg_url: req.user.desktop_bg_url,
|
||||
desktop_bg_color: req.user.desktop_bg_color,
|
||||
|
@ -53,7 +53,7 @@ export default {
|
||||
h += `</div>`;
|
||||
|
||||
// configure 2FA
|
||||
if(!user.is_temp){
|
||||
if(!user.is_temp && user.email_confirmed){
|
||||
h += `<div class="settings-card settings-card-security ${user.otp ? 'settings-card-success' : 'settings-card-warning'}">`;
|
||||
h += `<div>`;
|
||||
h += `<strong style="display:block;">${i18n('two_factor')}</strong>`;
|
||||
|
Loading…
Reference in New Issue
Block a user