Skip to content

doTokenThing may toss error on "no token" #390

@SmithPeder

Description

@SmithPeder

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 {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions