@accounts/server
Advanced tools
Comparing version 0.1.0-alpha.357173dd to 0.1.0-alpha.4170db8f
@@ -560,3 +560,3 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var user, resetTokens, resetTokenRecord, emails, password; | ||
var user, resetTokens, asArray, resetTokenRecord, emails, tokenAddress, password; | ||
return __generator(this, function (_a) { | ||
@@ -571,3 +571,4 @@ switch (_a.label) { | ||
resetTokens = get(user, ['services', 'password', 'reset']) || []; | ||
resetTokenRecord = (isArray(resetTokens) ? resetTokens : [resetTokens]).find(resetTokens, function (t) { return t.token === token; }); | ||
asArray = isArray(resetTokens) ? resetTokens : [resetTokens]; | ||
resetTokenRecord = find(asArray, function (t) { return t.token === token; }); | ||
if (this._isTokenExpired(token, resetTokenRecord)) { | ||
@@ -577,3 +578,4 @@ throw new common_1.AccountsError('Reset password link expired'); | ||
emails = user.emails || []; | ||
if (!includes(emails.map(function (email) { return email.address; }), resetTokenRecord.address)) { | ||
tokenAddress = resetTokenRecord.email || resetTokenRecord.address; | ||
if (!includes(emails.map(function (email) { return email.address; }), tokenAddress)) { | ||
throw new common_1.AccountsError('Token has invalid email address'); | ||
@@ -580,0 +582,0 @@ } |
{ | ||
"name": "@accounts/server", | ||
"version": "0.1.0-alpha.357173dd", | ||
"version": "0.1.0-alpha.4170db8f", | ||
"description": "Fullstack authentication and accounts-management", | ||
@@ -50,3 +50,2 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@accounts/common": "^0.1.0-alpha.357173dd", | ||
"babel-polyfill": "^6.23.0", | ||
@@ -60,3 +59,7 @@ "bcryptjs": "^2.4.0", | ||
}, | ||
"peerDependencies": { | ||
"@accounts/common": "^0.1.0-alpha.4170db8f" | ||
}, | ||
"devDependencies": { | ||
"@accounts/common": "^0.1.0-alpha.4170db8f", | ||
"coveralls": "^2.11.14", | ||
@@ -63,0 +66,0 @@ "jest": "^18.0.0", |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
87793
1239
0
5