We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cd5d4ef commit dd8ba8bCopy full SHA for dd8ba8b
lib/plugins/leetcode.js
@@ -534,15 +534,9 @@ 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);
+ const 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