diff --git a/oauth3.core.js b/oauth3.core.js index 524bffa..202d473 100644 --- a/oauth3.core.js +++ b/oauth3.core.js @@ -42,6 +42,12 @@ if (-1 !== ['#', '?'].indexOf(search[0])) { search = search.substring(1); } + // Solve for case of search within hash + // example: #/authorization_dialog/?state=...&redirect_uri=... + var queryIndex = search.indexOf('?'); + if (-1 !== queryIndex) { + search = search.substr(queryIndex + 1); + } var args = search.split('&'); var argsParsed = {}; @@ -88,7 +94,7 @@ }; var result = { - url: providerUri + '/.well-known/oauth3/directives.html#' + core.querystringify(params) + url: providerUri + '/.well-known/oauth3/#/?' + core.querystringify(params) , state: params.state , method: 'GET' , query: params