Skip to content

Commit

Permalink
Now the token issue is truly fixed, as the format length is ignored
Browse files Browse the repository at this point in the history
  • Loading branch information
SebOuellette committed Apr 29, 2022
1 parent b285a08 commit 938bfdd
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions js/setToken.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,19 +100,19 @@ async function validateToken(token = '') {
return [true, 'INVALID-TOKEN-CHARACTERS'];

let tA = token.split('.');
if (tA.length < 3 || tA.length > 3) return [true, 'INVALID-TOKEN-FORMAT'];
tA[0] = tA[0].length;
tA[1] = tA[1].length;
tA[2] = tA[2].length;
if (
tA[0] < 24 ||
tA[0] > 24 ||
tA[1] < 6 ||
tA[1] > 6 ||
tA[2] < 27 ||
tA[2] > 27
)
return [true, 'INVALID-TOKEN-FORMAT'];
if (tA.length != 3) return [true, 'INVALID-TOKEN-FORMAT'];
// tA[0] = tA[0].length;
// tA[1] = tA[1].length;
// tA[2] = tA[2].length;
// if (
// tA[0] < 24 ||
// tA[0] > 24 ||
// tA[1] < 6 ||
// tA[1] > 6 ||
// tA[2] < 27 ||
// tA[2] > 27
// )
// return [true, 'INVALID-TOKEN-FORMAT'];

return [false, 'none'];
}

0 comments on commit 938bfdd

Please sign in to comment.