Browse Source

fix: resolve redirect logout uri problem

pull/5611/head
mehmet-erim 6 years ago
parent
commit
f10503cd30
  1. 2
      npm/ng-packs/packages/core/src/lib/strategies/auth-flow.strategy.ts
  2. 3
      npm/ng-packs/packages/core/src/lib/utils/initial-utils.ts

2
npm/ng-packs/packages/core/src/lib/strategies/auth-flow.strategy.ts

@ -119,7 +119,7 @@ export const AUTH_FLOW_STRATEGY = {
}, },
}; };
function clearOAuthStorage(storage: OAuthStorage) { export function clearOAuthStorage(storage: OAuthStorage = oAuthStorage) {
const keys = [ const keys = [
'access_token', 'access_token',
'id_token', 'id_token',

3
npm/ng-packs/packages/core/src/lib/utils/initial-utils.ts

@ -7,6 +7,7 @@ import { GetAppConfiguration } from '../actions/config.actions';
import { ABP } from '../models/common'; import { ABP } from '../models/common';
import { AuthService } from '../services/auth.service'; import { AuthService } from '../services/auth.service';
import { ConfigState } from '../states/config.state'; import { ConfigState } from '../states/config.state';
import { clearOAuthStorage } from '../strategies/auth-flow.strategy';
import { CORE_OPTIONS } from '../tokens/options.token'; import { CORE_OPTIONS } from '../tokens/options.token';
import { getRemoteEnv } from './environment-utils'; import { getRemoteEnv } from './environment-utils';
import { parseTenantFromUrl } from './multi-tenancy-utils'; import { parseTenantFromUrl } from './multi-tenancy-utils';
@ -34,7 +35,7 @@ export function getInitialData(injector: Injector) {
export function checkAccessToken(store: Store, injector: Injector) { export function checkAccessToken(store: Store, injector: Injector) {
const oAuth = injector.get(OAuthService); const oAuth = injector.get(OAuthService);
if (oAuth.hasValidAccessToken() && !store.selectSnapshot(ConfigState.getDeep('currentUser.id'))) { if (oAuth.hasValidAccessToken() && !store.selectSnapshot(ConfigState.getDeep('currentUser.id'))) {
oAuth.logOut(); clearOAuthStorage();
} }
} }

Loading…
Cancel
Save