feat: Improve authentication adapter interface to support multi-factor authentication (MFA), authentication challenges, and provide a more powerful interface for writing custom authentication adapters (#8156)
This commit is contained in:
@@ -81,6 +81,7 @@ export class Config {
|
||||
enforcePrivateUsers,
|
||||
schema,
|
||||
requestKeywordDenylist,
|
||||
allowExpiredAuthDataToken,
|
||||
}) {
|
||||
if (masterKey === readOnlyMasterKey) {
|
||||
throw new Error('masterKey and readOnlyMasterKey should be different');
|
||||
@@ -120,6 +121,7 @@ export class Config {
|
||||
this.validateSecurityOptions(security);
|
||||
this.validateSchemaOptions(schema);
|
||||
this.validateEnforcePrivateUsers(enforcePrivateUsers);
|
||||
this.validateAllowExpiredAuthDataToken(allowExpiredAuthDataToken);
|
||||
this.validateRequestKeywordDenylist(requestKeywordDenylist);
|
||||
}
|
||||
|
||||
@@ -137,6 +139,12 @@ export class Config {
|
||||
}
|
||||
}
|
||||
|
||||
static validateAllowExpiredAuthDataToken(allowExpiredAuthDataToken) {
|
||||
if (typeof allowExpiredAuthDataToken !== 'boolean') {
|
||||
throw 'Parse Server option allowExpiredAuthDataToken must be a boolean.';
|
||||
}
|
||||
}
|
||||
|
||||
static validateSecurityOptions(security) {
|
||||
if (Object.prototype.toString.call(security) !== '[object Object]') {
|
||||
throw 'Parse Server option security must be an object.';
|
||||
|
||||
Reference in New Issue
Block a user