Improves validation of email parameters in Configuration
This commit is contained in:
@@ -16,8 +16,8 @@ export class AdaptableController {
|
||||
|
||||
constructor(adapter, appId, options) {
|
||||
this.options = options;
|
||||
this.adapter = adapter;
|
||||
this.appId = appId;
|
||||
this.adapter = adapter;
|
||||
}
|
||||
|
||||
set adapter(adapter) {
|
||||
@@ -62,8 +62,7 @@ export class AdaptableController {
|
||||
}, {});
|
||||
|
||||
if (Object.keys(mismatches).length > 0) {
|
||||
console.error(adapter, mismatches);
|
||||
throw new Error("Adapter prototype don't match expected prototype");
|
||||
throw new Error("Adapter prototype don't match expected prototype", adapter, mismatches);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -162,16 +162,12 @@ export class UserController extends AdaptableController {
|
||||
const token = encodeURIComponent(user._perishable_token);
|
||||
const username = encodeURIComponent(user.username);
|
||||
let link = `${this.config.requestResetPasswordURL}?token=${token}&username=${username}`
|
||||
|
||||
if (!user.username) {
|
||||
console.log('No username...');
|
||||
}
|
||||
|
||||
|
||||
let options = {
|
||||
appName: this.config.appName,
|
||||
link: link,
|
||||
user: inflate('_User', user),
|
||||
};
|
||||
appName: this.config.appName,
|
||||
link: link,
|
||||
user: inflate('_User', user),
|
||||
};
|
||||
|
||||
if (this.adapter.sendPasswordResetEmail) {
|
||||
this.adapter.sendPasswordResetEmail(options);
|
||||
|
||||
Reference in New Issue
Block a user