admin -> dashboard

This commit is contained in:
Girish Ramakrishnan
2021-05-05 12:29:04 -07:00
parent cc9b43450c
commit 44ac406e57
28 changed files with 104 additions and 104 deletions

View File

@@ -631,7 +631,7 @@ function getOwner(callback) {
}
function inviteLink(user, directoryConfig) {
let link = `${settings.adminOrigin()}/setupaccount.html?resetToken=${user.resetToken}&email=${encodeURIComponent(user.email)}`;
let link = `${settings.dashboardOrigin()}/setupaccount.html?resetToken=${user.resetToken}&email=${encodeURIComponent(user.email)}`;
if (user.username) link += `&username=${encodeURIComponent(user.username)}`;
if (user.displayName) link += `&displayName=${encodeURIComponent(user.displayName)}`;
@@ -719,7 +719,7 @@ function setTwoFactorAuthenticationSecret(userId, callback) {
if (result.twoFactorAuthenticationEnabled) return callback(new BoxError(BoxError.ALREADY_EXISTS));
var secret = speakeasy.generateSecret({ name: `Cloudron ${settings.adminFqdn()} (${result.username})` });
var secret = speakeasy.generateSecret({ name: `Cloudron ${settings.dashboardFqdn()} (${result.username})` });
userdb.update(userId, { twoFactorAuthenticationSecret: secret.base32, twoFactorAuthenticationEnabled: false }, function (error) {
if (error) return callback(error);
@@ -863,7 +863,7 @@ function getAvatarUrl(user, callback) {
userdb.getAvatar(user.id, function (error, avatar) {
if (error) return callback(error);
if (avatar) return callback(null, `${settings.adminOrigin()}/api/v1/profile/avatar/${user.id}`);
if (avatar) return callback(null, `${settings.dashboardOrigin()}/api/v1/profile/avatar/${user.id}`);
const emailHash = require('crypto').createHash('md5').update(user.email).digest('hex');
return callback(null, `https://www.gravatar.com/avatar/${emailHash}.jpg`);