Skip to content

State with =, & characters is incorrectly parsed from url fragment #913

Closed

Description

@selaux

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.

  • Code snippet or sample project that reproduces the bug
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);
});
  • Lock version: 10.12.3
  • Browser & OS: Any

Activity

  1. added
    bug
    on Mar 10, 2017
  2. added this to the v10-Next milestone on Mar 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions