#29-add-admin-role #2

Merged
philipp merged 10 commits from #29-add-admin-role into fork 2022-11-08 16:36:18 +01:00
3 changed files with 7 additions and 7 deletions
Showing only changes of commit d8f7fa36e1 - Show all commits

1
public/env.js vendored
View file

@ -1,3 +1,4 @@
window.env = { window.env = {
REACT_APP_API_URL: 'http://localhost:5000/api/v1', REACT_APP_API_URL: 'http://localhost:5000/api/v1',
REACT_APP_SSO_LOGOUT_URL: 'https://login.example.org/if/flow/default-invalidation-flow/'
}; };

View file

@ -10,7 +10,8 @@ import _ from 'lodash';
import { UserModal } from '../UserModal'; 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 = [ const navigation = [
{ name: 'Dashboard', to: '/dashboard', requiresAdmin: false }, { name: 'Dashboard', to: '/dashboard', requiresAdmin: false },
@ -56,10 +57,7 @@ const HeaderLIT: React.FC<HeaderProps> = () => {
const signOutUrl = useMemo(() => { const signOutUrl = useMemo(() => {
const { hostname } = window.location; const { hostname } = window.location;
// If we are developing locally, we need to use the init cluster's public URL // If we are developing locally, we need to use the init cluster's public URL
if (hostname === 'localhost') {
return HYDRA_LOGOUT_URL; return HYDRA_LOGOUT_URL;
}
return `https://${hostname.replace(/^dashboard/, 'sso')}/oauth2/sessions/logout`;
}, []); }, []);
return ( return (

View file

@ -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'; import { SuccessAction } from 'src/services/api/redux/types';
export enum AuthActionTypes { export enum AuthActionTypes {
@ -26,7 +27,7 @@ export const signIn = (params: string) =>
); );
export function signOut() { export function signOut() {
return (dispatch: any) => { return async (dispatch: any) => {
dispatch(signOutAction()); dispatch(signOutAction());
}; };
} }