8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cd5d4ef commit bca58abCopy full SHA for bca58ab
lib/plugins/leetcode.js
@@ -534,15 +534,10 @@ plugin.login = function(user, cb) {
534
};
535
536
function parseCookie(cookie, body, cb) {
537
- const isCN = config.app === 'leetcode.cn';
538
const SessionPattern = /LEETCODE_SESSION=(.+?)(;|$)/;
539
let csrfPattern;
540
- if (isCN) {
541
- csrfPattern = /name="csrfmiddlewaretoken" value="(.*?)"/;
542
- } else {
543
- csrfPattern = /csrftoken=(.+?)(;|$)/;
544
- }
545
- const reCsrfResult = csrfPattern.exec(isCN? body: cookie);
+ csrfPattern = /csrftoken=(.+?)(;|$)/;
+ const reCsrfResult = csrfPattern.exec(cookie);
546
const reSessionResult = SessionPattern.exec(cookie);
547
if (reSessionResult === null || reCsrfResult === null) {
548
return cb('invalid cookie?');
0 commit comments