Whenever the state in the login callback url fragment includes an equal sign, it looses anything after the equal sign. The reason for that it that decodeUriComponent is called on the whole url fragment before parsing it, leading to encoded characters in state to make new query params instead of still belonging to hash.
const lock = new Lock('clientId', 'domain', {
auth: {
responseType: 'token',
params: {
// example 1
state: '/some/path/to/redirect?q=firstparam&p=secondparam',
// example 2
state: 'asd&q=firstparam&p=secondparam'
}
}
});
lock.on('authenticated', function (result) {
// will log /some/path/to/redirect?q= for example 1
// will log asd for example 2
console.log(result.state);
});
Whenever the state in the login callback url fragment includes an equal sign, it looses anything after the equal sign. The reason for that it that
decodeUriComponentis called on the whole url fragment before parsing it, leading to encoded characters in state to make new query params instead of still belonging to hash.