Added check for external auth and page refresh

This commit is contained in:
Michael Spalti
2023-04-05 19:44:46 -07:00
committed by Michael W Spalti
parent ade9533f4c
commit 290a89909e
9 changed files with 104 additions and 4 deletions

View File

@@ -25,7 +25,7 @@ import {
import { CookieService } from '../services/cookie.service';
import {
getAuthenticatedUserId,
getAuthenticationToken,
getAuthenticationToken, getExternalAuthCookieStatus,
getRedirectUrl,
isAuthenticated,
isAuthenticatedLoaded,
@@ -36,7 +36,7 @@ import { AppState } from '../../app.reducer';
import {
CheckAuthenticationTokenAction,
RefreshTokenAction,
ResetAuthenticationMessagesAction,
ResetAuthenticationMessagesAction, SetAuthCookieStatus,
SetRedirectUrlAction,
SetUserAsIdleAction,
UnsetUserAsIdleAction
@@ -156,6 +156,15 @@ export class AuthService {
return this.store.pipe(select(isAuthenticatedLoaded));
}
public setExternalAuthStatus(external: boolean) {
this.store.dispatch(new SetAuthCookieStatus(external));
}
public isExternalAuthentication(): Observable<boolean> {
return this.store.pipe(
select(getExternalAuthCookieStatus));
}
/**
* Returns the href link to authenticated user
* @returns {string}