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

doTokenThing may toss error on "no token" #390

Open
SmithPeder opened this issue Jan 23, 2021 · 0 comments
Open

doTokenThing may toss error on "no token" #390

SmithPeder opened this issue Jan 23, 2021 · 0 comments

Comments

@SmithPeder
Copy link
Member

There is something wrong here:

const [u, p, code] = getTokenFromUrl(url).split(':');

If you stay on the blank loginpage for a while ~2 min or so this is thrown:
alert('Det skjedde en feil. Prøv på nytt');

// console
login.js:3681 Unable to decode token:  TypeError: Cannot read property 'split' of null
    at doTokenThing (login.js:3641)
    at login.js:3692

So I think this is run when it'd not suppose to

vote/client/login.js

Lines 61 to 64 in d2e30c5

const token = getTokenFromUrl(window.location.href);
if (token) {
doTokenThing(window.location.href);
} else {

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