Adds password expiry support to password policy (#3068)

* Adding support for password expiry policy

* Renamed daysBeforeExpiry -> maxPasswordAge
This commit is contained in:
Bhaskar Reddy Yasa
2016-11-21 21:16:38 +05:30
committed by Diwakar Cherukumilli
parent 11c6170ed1
commit edb7b70ced
8 changed files with 397 additions and 89 deletions

View File

@@ -467,6 +467,7 @@ export class PostgresStorageAdapter {
fields._failed_login_count = {type: 'Number'};
fields._perishable_token = {type: 'String'};
fields._perishable_token_expires_at = {type: 'Date'};
fields._password_changed_at = {type: 'Date'};
}
let index = 2;
let relations = [];
@@ -693,7 +694,8 @@ export class PostgresStorageAdapter {
}
if (fieldName === '_account_lockout_expires_at'||
fieldName === '_perishable_token_expires_at') {
fieldName === '_perishable_token_expires_at'||
fieldName === '_password_changed_at') {
if (object[fieldName]) {
valuesArray.push(object[fieldName].iso);
} else {
@@ -1075,7 +1077,9 @@ export class PostgresStorageAdapter {
if (object._perishable_token_expires_at) {
object._perishable_token_expires_at = { __type: 'Date', iso: object._perishable_token_expires_at.toISOString() };
}
if (object._password_changed_at) {
object._password_changed_at = { __type: 'Date', iso: object._password_changed_at.toISOString() };
}
for (let fieldName in object) {
if (object[fieldName] === null) {