auth0 / angular-lock

MIT License
18 stars 15 forks source link

Replace direct query of window.location.hash with the location service #27

Closed jmangelo closed 7 years ago

jmangelo commented 7 years ago

The previous logic that was extracting the hash from window.location.hash was leading to hashes similar to the following when not using HTLML5 mode:

#!#access_token=XyZ&id_token=ey...

Passing an hash in this format was resulting in Auth0.js ignoring the access_token response parameter and returning an incomplete authResult.

Updating the previous logic to use $location.hash() showed that in both HTML5 mode and non-HTML5 mode the returned hash would now be similar to:

access_token=XyZ&id_token=ey...

A few tests demonstrated that Auth0.js correctly handled this format (even without the initial # character at the start) and would now correctly return a complete response that included the returned access_token.