mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-11 00:08:30 +01:00
fix: emailservice now just returns if email was configured
This commit is contained in:
parent
7cb7e4a193
commit
97d77d84cc
@ -99,15 +99,18 @@ class FeatureToggleStore {
|
||||
}
|
||||
|
||||
async getProjectId(name) {
|
||||
return this.db
|
||||
.first(['project'])
|
||||
.from(TABLE)
|
||||
.where({ name })
|
||||
.then(r => (r ? r.project : undefined))
|
||||
.catch(e => {
|
||||
this.logger.error(e);
|
||||
return undefined;
|
||||
});
|
||||
if (name) {
|
||||
return this.db
|
||||
.first(['project'])
|
||||
.from(TABLE)
|
||||
.where({ name })
|
||||
.then(r => (r ? r.project : undefined))
|
||||
.catch(e => {
|
||||
this.logger.error(e);
|
||||
return undefined;
|
||||
});
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
async hasFeature(name) {
|
||||
|
@ -108,9 +108,8 @@ export default class UserAdminController extends Controller {
|
||||
);
|
||||
|
||||
const emailConfigured = this.emailService.configured();
|
||||
let sentMetaData = null;
|
||||
if (emailConfigured) {
|
||||
sentMetaData = await this.emailService.sendGettingStartedMail(
|
||||
await this.emailService.sendGettingStartedMail(
|
||||
createdUser.name,
|
||||
createdUser.email,
|
||||
inviteLink.toString(),
|
||||
@ -121,13 +120,10 @@ export default class UserAdminController extends Controller {
|
||||
);
|
||||
}
|
||||
|
||||
const emailSent =
|
||||
sentMetaData?.response.includes(MAIL_ACCEPTED) || false;
|
||||
|
||||
res.status(201).send({
|
||||
...createdUser,
|
||||
inviteLink,
|
||||
emailSent,
|
||||
emailSent: emailConfigured,
|
||||
rootRole,
|
||||
});
|
||||
} catch (e) {
|
||||
|
Loading…
Reference in New Issue
Block a user