Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Carlos
/
passport-imap
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
29f8e077
authored
Jan 09, 2017
by
Jose Carlos López
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix close connection to imap server
parent
7634621c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
lib/passport-imap/strategy.js
lib/passport-imap/strategy.js
View file @
29f8e077
...
@@ -62,16 +62,20 @@ Strategy.prototype.authenticate = function(req, options) {
...
@@ -62,16 +62,20 @@ Strategy.prototype.authenticate = function(req, options) {
var
user
=
self
.
_success_callback
(
this
,
imap
);
var
user
=
self
.
_success_callback
(
this
,
imap
);
if
(
!
user
.
id
)
{
if
(
!
user
.
id
)
{
console
.
log
(
"Success fallback must return an object with id parameter!"
);
console
.
log
(
"Success fallback must return an object with id parameter!"
);
imap
.
end
();
return
self
.
fail
(
"Success fallback must return an object with id parameter!"
);
return
self
.
fail
(
"Success fallback must return an object with id parameter!"
);
}
}
self
.
success
(
user
,
"success"
);
self
.
success
(
user
,
"success"
);
imap
.
end
();
}
else
{
}
else
{
console
.
log
(
"Success fallback is required to generate the user!"
);
console
.
log
(
"Success fallback is required to generate the user!"
);
imap
.
end
();
return
self
.
fail
(
"Success fallback is required to generate the user!"
);
return
self
.
fail
(
"Success fallback is required to generate the user!"
);
}
}
});
});
imap
.
connect
();
imap
.
connect
();
imap
.
once
(
'error'
,
function
(
err
)
{
imap
.
once
(
'error'
,
function
(
err
)
{
imap
.
end
();
return
self
.
fail
(
"Invalid credantials"
);
return
self
.
fail
(
"Invalid credantials"
);
});
});
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment