Skip to content
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

Error in regular expression to find the csrf_token #8

Open
Dukebot opened this issue Dec 22, 2023 · 0 comments
Open

Error in regular expression to find the csrf_token #8

Dukebot opened this issue Dec 22, 2023 · 0 comments

Comments

@Dukebot
Copy link

Dukebot commented Dec 22, 2023

I used this module for a while and everything worked perfect but recently I started to get error when attempting to find the csrf_token in the _login() function.

I started to debug the issue and found that the regular expression used to find the csrf_token was:

var pattern = new RegExp(/(csrf_token\\":\\")[\w]+/);

But this is not matching the token anymore for no apparent reason.

I tried to tweak the regular expression and found that if I use one slash \ instead of \\ it's works and match the token:

var pattern = new RegExp(/(csrf_token\":\")[\w]+/);

I don't know if this problem only happens to me or not, and I don't understand why this started to happen all of a sudden.

Maybe the code could be updated for trying to match with \ and \\ slashed if the first one don't find the token.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant