X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/63a5dc75ae9b68b3570e3bee1662155572cf5d1f..62cb779efb0b098c05053e957c765a807467b28b:/src/store/auth/auth-action.ts diff --git a/src/store/auth/auth-action.ts b/src/store/auth/auth-action.ts index 7fc9df77..6eb8356f 100644 --- a/src/store/auth/auth-action.ts +++ b/src/store/auth/auth-action.ts @@ -92,6 +92,9 @@ export const saveApiToken = (token: string) => async (dispatch: Dispatch, getSta // If the token is from a LoginCluster federation, get user & token data // from the token issuing cluster. + if (!config) { + return; + } const lc = (config as Config).loginCluster const tokenCluster = tokenParts.length === 3 ? tokenParts[1].substring(0, 5) @@ -127,7 +130,7 @@ export const getNewExtraToken = (reuseStored: boolean = false) => const client = await svc.apiClientAuthorizationService.get('current'); dispatch(authActions.SET_EXTRA_TOKEN({ extraApiToken: extraToken, - extraApiTokenExpiration: client.expiresAt ? new Date(client.expiresAt): undefined, + extraApiTokenExpiration: client.expiresAt ? new Date(client.expiresAt) : undefined, })); return extraToken; } catch (e) { @@ -145,7 +148,7 @@ export const getNewExtraToken = (reuseStored: boolean = false) => const newExtraToken = getTokenV2(client); dispatch(authActions.SET_EXTRA_TOKEN({ extraApiToken: newExtraToken, - extraApiTokenExpiration: client.expiresAt ? new Date(client.expiresAt): undefined, + extraApiTokenExpiration: client.expiresAt ? new Date(client.expiresAt) : undefined, })); return newExtraToken; } catch {