X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/e6e91f83b899ef4a05a1b3af56d78388058c5e73..59caadc58a0b7ffc92fa95c90b16c99a9af6d942:/src/store/auth/auth-action.ts diff --git a/src/store/auth/auth-action.ts b/src/store/auth/auth-action.ts index 07426b75..ac2e0b7e 100644 --- a/src/store/auth/auth-action.ts +++ b/src/store/auth/auth-action.ts @@ -31,17 +31,16 @@ function removeAuthorizationHeader(client: AxiosInstance) { delete client.defaults.headers.common.Authorization; } -export const initAuth = () => - (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => { - const user = services.authService.getUser(); - const token = services.authService.getApiToken(); - if (token) { - setAuthorizationHeader(services, token); - } - if (token && user) { - dispatch(authActions.INIT({ user, token })); - } - }; +export const initAuth = () => (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => { + const user = services.authService.getUser(); + const token = services.authService.getApiToken(); + if (token) { + setAuthorizationHeader(services, token); + } + if (token && user) { + dispatch(authActions.INIT({ user, token })); + } +}; export const saveApiToken = (token: string) => (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => { services.authService.saveApiToken(token);