make logout redirect a env var
This commit is contained in:
parent
9d9f95f99d
commit
d8f7fa36e1
3 changed files with 7 additions and 7 deletions
1
public/env.js
vendored
1
public/env.js
vendored
|
@ -1,3 +1,4 @@
|
|||
window.env = {
|
||||
REACT_APP_API_URL: 'http://localhost:5000/api/v1',
|
||||
REACT_APP_SSO_LOGOUT_URL: 'https://login.example.org/if/flow/default-invalidation-flow/'
|
||||
};
|
||||
|
|
|
@ -10,7 +10,8 @@ import _ from 'lodash';
|
|||
|
||||
import { UserModal } from '../UserModal';
|
||||
|
||||
const HYDRA_LOGOUT_URL = `${process.env.REACT_APP_HYDRA_PUBLIC_URL}/oauth2/sessions/logout`;
|
||||
// @ts-ignore
|
||||
const HYDRA_LOGOUT_URL = window.env.REACT_APP_SSO_LOGOUT_URL;
|
||||
|
||||
const navigation = [
|
||||
{ name: 'Dashboard', to: '/dashboard', requiresAdmin: false },
|
||||
|
@ -56,10 +57,7 @@ const HeaderLIT: React.FC<HeaderProps> = () => {
|
|||
const signOutUrl = useMemo(() => {
|
||||
const { hostname } = window.location;
|
||||
// If we are developing locally, we need to use the init cluster's public URL
|
||||
if (hostname === 'localhost') {
|
||||
return HYDRA_LOGOUT_URL;
|
||||
}
|
||||
return `https://${hostname.replace(/^dashboard/, 'sso')}/oauth2/sessions/logout`;
|
||||
}, []);
|
||||
|
||||
return (
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import { createApiAction } from 'src/services/api';
|
||||
import axios from 'axios';
|
||||
import { createApiAction, createApiCall, performApiCall } from 'src/services/api';
|
||||
import { SuccessAction } from 'src/services/api/redux/types';
|
||||
|
||||
export enum AuthActionTypes {
|
||||
|
@ -26,7 +27,7 @@ export const signIn = (params: string) =>
|
|||
);
|
||||
|
||||
export function signOut() {
|
||||
return (dispatch: any) => {
|
||||
return async (dispatch: any) => {
|
||||
dispatch(signOutAction());
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue