idea-toolbox
Version:
IDEA's utility functions
20 lines (19 loc) • 764 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.EmailChangeRequest = void 0;
const resource_model_1 = require("./resource.model");
/**
* Helper structure to create a confirmation flow before to change the email address used for login.
*
* Table: `idea_emailChangeRequests`.
*/
class EmailChangeRequest extends resource_model_1.Resource {
load(x) {
super.load(x);
this.confirmationCode = this.clean(x.confirmationCode, String);
this.oldEmail = this.clean(x.oldEmail, String);
this.newEmail = this.clean(x.newEmail, String);
this.expiresAt = this.clean(x.expiresAt, Number, Date.now() + 3600 * 24 * 30); // 1 month from now
}
}
exports.EmailChangeRequest = EmailChangeRequest;