angular-token-auth
angular-token-auth copied to clipboard
Decoder should replace all
I'm not a user, but I did notice and copy your url_base64_decoder for a project of my own. I've noticed the following issue with it which you may want to fix:
https://github.com/auth0-blog/angular-token-auth/blob/master/auth.client.js#L5:
var output = str.replace('-', '+').replace('_', '/');
should in fact be doing a replace All:
const reg1 = new RegExp("_", "g");
const reg2 = new RegExp("-", "g");
let output = str.replace(reg2, '+').replace(reg1, '/');
Clarification: There is nothing limiting a string to a single "_" or "-" character.