amelisa-auth
Advanced tools
Comparing version 0.1.3 to 0.1.4
@@ -64,20 +64,25 @@ 'use strict'; | ||
profile.refreshToken = refreshToken;userId = req.session.userId; | ||
_context.prev = 17; | ||
_context.next = 20; | ||
// Generate userId if absent | ||
if (!userId) userId = model.id(); | ||
_context.prev = 18; | ||
_context.next = 21; | ||
return this.registerProvider(userId, profile.provider, profile); | ||
case 20: | ||
_context.next = 25; | ||
case 21: | ||
_context.next = 26; | ||
break; | ||
case 22: | ||
_context.prev = 22; | ||
_context.t1 = _context['catch'](17); | ||
case 23: | ||
_context.prev = 23; | ||
_context.t1 = _context['catch'](18); | ||
return _context.abrupt('return', done(_context.t1)); | ||
case 25: | ||
case 26: | ||
done(null, userId); | ||
case 26: | ||
case 27: | ||
case 'end': | ||
@@ -87,3 +92,3 @@ return _context.stop(); | ||
} | ||
}, _callee, this, [[2, 7], [17, 22]]); | ||
}, _callee, this, [[2, 7], [18, 23]]); | ||
})); | ||
@@ -90,0 +95,0 @@ return function verifyCallback(_x, _x2, _x3, _x4, _x5) { |
@@ -32,6 +32,6 @@ 'use strict'; | ||
var userDoc = model.doc('auths', userId); | ||
var $user = model.doc('auths', userId); | ||
userDoc.fetch().then(function () { | ||
var user = userDoc.get(); | ||
$user.fetch().then(function () { | ||
var user = $user.get(); | ||
@@ -38,0 +38,0 @@ if (!user && isAuthenticated) { |
@@ -93,3 +93,2 @@ 'use strict'; | ||
if (err) return reject(err); | ||
// Everything is ok, login user | ||
@@ -96,0 +95,0 @@ _this.login(userId, req).then(function () { |
{ | ||
"name": "amelisa-auth", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
79257
1965