From 2d10171de71b8ed8dc4a31ccd8584989478e7114 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Mon, 6 Feb 2017 14:41:25 -0700 Subject: [PATCH] handle nested search in hash and discover as index.html --- oauth3.core.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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