fix(User): Fix typos
This commit is contained in:
committed by
mrugesh mohapatra
parent
13b7eac16f
commit
9c5322334b
@ -101,7 +101,7 @@ module.exports = function enableAuthentication(app) {
|
|||||||
// first find
|
// first find
|
||||||
return AccessToken.findOne$({ where: { id: authTokenId } })
|
return AccessToken.findOne$({ where: { id: authTokenId } })
|
||||||
.flatMap(authToken => {
|
.flatMap(authToken => {
|
||||||
if (authToken) {
|
if (!authToken) {
|
||||||
throw wrapHandledError(
|
throw wrapHandledError(
|
||||||
new Error(`no token found for id: ${authTokenId}`),
|
new Error(`no token found for id: ${authTokenId}`),
|
||||||
{
|
{
|
||||||
@ -113,7 +113,7 @@ module.exports = function enableAuthentication(app) {
|
|||||||
}
|
}
|
||||||
// find user then validate and destroy email validation token
|
// find user then validate and destroy email validation token
|
||||||
// finally retun user instance
|
// finally retun user instance
|
||||||
return Observable.fromNodeCallback(authToken.user.bind(authToken))
|
return User.findOne$({ where: { id: authToken.userId } })
|
||||||
.flatMap(user => {
|
.flatMap(user => {
|
||||||
if (!user) {
|
if (!user) {
|
||||||
throw wrapHandledError(
|
throw wrapHandledError(
|
||||||
@ -175,7 +175,7 @@ module.exports = function enableAuthentication(app) {
|
|||||||
user.emailVerifyTTL = emailVerifyTTL;
|
user.emailVerifyTTL = emailVerifyTTL;
|
||||||
});
|
});
|
||||||
|
|
||||||
const createToken = user.createAccessToken()
|
const createToken = user.createAccessToken$()
|
||||||
.do(accessToken => {
|
.do(accessToken => {
|
||||||
const config = {
|
const config = {
|
||||||
signed: !!req.signedCookies,
|
signed: !!req.signedCookies,
|
||||||
|
Reference in New Issue
Block a user