diff --git a/projects/lib/src/oauth-service.ts b/projects/lib/src/oauth-service.ts index a5fbfd14..8aa8c139 100644 --- a/projects/lib/src/oauth-service.ts +++ b/projects/lib/src/oauth-service.ts @@ -1745,16 +1745,11 @@ export class OAuthService extends AuthConfig implements OnDestroy { location.origin + location.pathname + location.search - .replace(/code=[^&\$]*/, '') - .replace(/scope=[^&\$]*/, '') - .replace(/state=[^&\$]*/, '') - .replace(/session_state=[^&\$]*/, '') - .replace(/^\?&/, '?') - .replace(/&$/, '') - .replace(/^\?$/, '') - .replace(/&+/g, '&') - .replace(/\?&/, '?') - .replace(/\?$/, '') + + .replace(/[&?]code=[^&\$]*/, '') + .replace(/[&?]scope=[^&\$]*/, '') + .replace(/[&?]state=[^&\$]*/, '') + .replace(/[&?]session_state=[^&\$]*/, '') + .replace(/^&/, '?') + location.hash; history.replaceState(null, window.name, href);