capacitor-community / generic-oauth2

Generic Capacitor OAuth 2 client plugin. Stop the war in Ukraine!
MIT License
223 stars 106 forks source link

Parse URL Parameters Properly #183

Closed jvartanian closed 1 year ago

jvartanian commented 2 years ago

Currently, URL fragments are being treated as a part of the query string. These are two distinct pieces of a URL, and should be handled separately. This PR updates the logic within WebUtils.getUrlParams() to:

jvartanian commented 2 years ago

This resolves #182

mikemellor11 commented 1 year ago

The example facebook Web flow also currently fails due to the returned response not being parsed correctly.

The Url from the provider/facebook is returned as:

http://localhost:3000/login?#access_token=...

Which then gets parsed as

{
  "#access_token": "..."
}

Which then thows ERR_NO_ACCESS_TOKEN as it doesn't expect to find the hash

moberwasserlechner commented 1 year ago

Thanks for this PR