Use branding.getCloudronName(); for totp secret name metadata
This commit is contained in:
committed by
Johannes Zellner
parent
f14dfb6c17
commit
0b968b6a98
+3
-2
@@ -4,6 +4,7 @@ import BoxError from './boxerror.js';
|
||||
import crypto from 'node:crypto';
|
||||
import constants from './constants.js';
|
||||
import dashboard from './dashboard.js';
|
||||
import branding from './branding.js';
|
||||
import database from './database.js';
|
||||
import debugModule from 'debug';
|
||||
import eventlog from './eventlog.js';
|
||||
@@ -921,8 +922,8 @@ async function setTwoFactorAuthenticationSecret(user, auditSource) {
|
||||
|
||||
if (user.twoFactorAuthenticationEnabled) throw new BoxError(BoxError.ALREADY_EXISTS, '2FA is already enabled');
|
||||
|
||||
const { fqdn:dashboardFqdn } = await dashboard.getLocation();
|
||||
const secret = speakeasy.generateSecret({ name: `Cloudron ${dashboardFqdn} (${user.username})` });
|
||||
const cloudronName = await branding.getCloudronName();
|
||||
const secret = speakeasy.generateSecret({ name: `${cloudronName}` });
|
||||
|
||||
await update(user, { twoFactorAuthenticationSecret: secret.base32, twoFactorAuthenticationEnabled: false }, auditSource);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user