Skip to content

Commit

Permalink
Merge branch 'bugfix/2526-add-groups-scope' into q/2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
bert-e committed May 7, 2020
2 parents f5d4ccd + d48fcbf commit 8ceed26
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions ui/src/ducks/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,14 @@ const defaultState = {
client_id: 'metalk8s-ui',
redirect_uri: 'http://localhost:3000/callback',
response_type: 'id_token',
scope:
'openid profile email offline_access audience:server:client_id:oidc-auth-client',
scope: [
'openid',
'profile',
'email',
'groups',
'offline_access', // For refresh tokens, not sure if that's useful
'audience:server:client_id:oidc-auth-client', // A token for apiserver
].join(' '),
authority: '',
loadUserInfo: false,
post_logout_redirect_uri: '/',
Expand Down Expand Up @@ -130,8 +136,8 @@ export function setThemesAction(themes) {
}

// Selectors
export const languageSelector = state => state.config.language;
export const apiConfigSelector = state => state.config.api;
export const languageSelector = (state) => state.config.language;
export const apiConfigSelector = (state) => state.config.api;

// Sagas
export function* fetchTheme() {
Expand Down Expand Up @@ -163,17 +169,17 @@ export function* fetchConfig() {
}),
);
const userManagerConfig = yield select(
state => state.config.userManagerConfig,
(state) => state.config.userManagerConfig,
);
yield put(setUserManagerAction(createUserManager(userManagerConfig)));
const userManager = yield select(state => state.config.userManager);
const userManager = yield select((state) => state.config.userManager);
yield call(loadUser, store, userManager);
yield put(setUserLoadedAction(true));
}
}

export function* updateApiServerConfig({ payload }) {
const api = yield select(state => state.config.api);
const api = yield select((state) => state.config.api);
if (api) {
yield call(
ApiK8s.updateApiServerConfig,
Expand Down Expand Up @@ -207,7 +213,7 @@ export function* updateLanguage(action) {
}

export function* logout() {
const userManager = yield select(state => state.config.userManager);
const userManager = yield select((state) => state.config.userManager);
if (userManager) {
userManager.removeUser(); // removes the user data from sessionStorage
}
Expand Down

0 comments on commit 8ceed26

Please sign in to comment.