Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

add leetcode user -c that user can login with cookie #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 2, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
drop log
  • Loading branch information
yihong0618 committed Nov 29, 2019
commit 906e083592057febdea9ddf2ed5dda29646f1b90
2 changes: 0 additions & 2 deletions lib/plugins/leetcode.js
Original file line number Diff line number Diff line change
Expand Up @@ -544,13 +544,11 @@ plugin.cookieLogin = function(user, cb) {
const csrfPattern = /csrftoken=(.+?)(;|$)/;
const reSessionResult = SessionPattern.exec(user.cookie);
const reCsrfResult = csrfPattern.exec(user.cookie);
console.log(reCsrfResult);
if (reSessionResult === null || reCsrfResult === null) {
return cb('invalid cookie?')
}
user.sessionId = reSessionResult[1];
user.sessionCSRF = reCsrfResult[1];
console.log(user.sessionCSRF);
session.saveUser(user);
plugin.getUser(user, cb);
}
Expand Down