Is there any way to get URL hash values as Map or ...
# javascript
m
Is there any way to get URL hash values as Map or data class? I already could get hashes as string (props.location.hash), but I want to parse it.
s
Hash doesnt have a format
m
I'll parse oauth redirected response, so it has format.
example,
Copy code
<http://localhost:8080/oauth#access_token=foobarfoobar&token_type=token>...
If it has no way with default, I'll try to parse in myself.
d
Why is the access token in the hash of an url?
The server exchanges the code for the access token, right? why is the access token on the client side/in the URL
r
You can probably use any JS router library to automatically parse parameters in hash.
s
r
I don't think
URLSearchParams
works with
#
fragments
s
You feed it the hash value (minus #). Not the entire url
r
right, it should work