Skip to content

Commit

Permalink
fix(@aws-amplify/auth): Default hash to # when null (#6279)
Browse files Browse the repository at this point in the history
  • Loading branch information
ericclemmons authored Aug 10, 2020
1 parent c1256bb commit eb97194
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/auth/src/OAuth/OAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,9 @@ export default class OAuth {
}

private async _handleImplicitFlow(currentUrl: string) {
const { id_token, access_token } = parse(currentUrl)
.hash.substr(1) // Remove # from returned code
// hash is `null` if `#` doesn't exist on URL
const { id_token, access_token } = (parse(currentUrl).hash || '#')
.substr(1) // Remove # from returned code
.split('&')
.map(pairings => pairings.split('='))
.reduce((accum, [k, v]) => ({ ...accum, [k]: v }), {
Expand Down

0 comments on commit eb97194

Please sign in to comment.