feat(User/Auth): Use stand alone auth token
This commit is contained in:
committed by
mrugesh mohapatra
parent
7a922229f4
commit
07f30427cb
@ -483,6 +483,12 @@ module.exports = function(User) {
|
||||
}
|
||||
);
|
||||
|
||||
User.prototype.createAuthToken = function createAuthToken({ ttl } = {}) {
|
||||
return Observable.fromNodeCallback(
|
||||
this.authTokens.create.bind(this.authTokens)
|
||||
)({ ttl });
|
||||
};
|
||||
|
||||
User.prototype.getEncodedEmail = function getEncodedEmail() {
|
||||
if (!this.email) {
|
||||
return null;
|
||||
@ -506,7 +512,7 @@ module.exports = function(User) {
|
||||
}
|
||||
|
||||
// create a temporary access token with ttl for 15 minutes
|
||||
return this.createAccessToken$({ ttl: 15 * 60 * 1000 });
|
||||
return this.createAuthToken({ ttl: 15 * 60 * 1000 });
|
||||
})
|
||||
.flatMap(token => {
|
||||
let renderAuthEmail = renderSignInEmail;
|
||||
|
Reference in New Issue
Block a user