Skip to content

Commit 9e257d0

Browse files
authored
fix: fix scope/state removal for implicit flow with hash
1 parent 8d152c2 commit 9e257d0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

projects/lib/src/oauth-service.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1629,11 +1629,11 @@ export class OAuthService extends AuthConfig implements OnDestroy {
16291629
const sessionState = parts['session_state'];
16301630

16311631
if (!options.preventClearHashAfterLogin) {
1632-
const href = location.href
1633-
.replace(/[&\?]code=[^&\$]*/, '')
1632+
const href = location.origin + location.pathname +
1633+
location.search.replace(/[&\?]code=[^&\$]*/, '')
16341634
.replace(/[&\?]scope=[^&\$]*/, '')
16351635
.replace(/[&\?]state=[^&\$]*/, '')
1636-
.replace(/[&\?]session_state=[^&\$]*/, '');
1636+
.replace(/[&\?]session_state=[^&\$]*/, '') + location.hash;
16371637

16381638
history.replaceState(null, window.name, href);
16391639
}

0 commit comments

Comments
 (0)