X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/e5b901f7d6f87b56f43d3dbe002c9c90a3d41349..28f13ae4d15f4f80ff3834d6a7422b4259672a20:/src/store/auth/auth-reducer.ts diff --git a/src/store/auth/auth-reducer.ts b/src/store/auth/auth-reducer.ts index f6974fd2..366385d5 100644 --- a/src/store/auth/auth-reducer.ts +++ b/src/store/auth/auth-reducer.ts @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: AGPL-3.0 -import actions, { AuthAction } from "./auth-action"; +import { authActions, AuthAction } from "./auth-action"; import { User } from "../../models/user"; import { authService } from "../../services/services"; import { removeServerApiAuthorizationHeader, setServerApiAuthorizationHeader } from "../../common/api/server-api"; @@ -12,8 +12,8 @@ export interface AuthState { apiToken?: string; } -const authReducer = (state: AuthState = {}, action: AuthAction) => { - return actions.match(action, { +export const authReducer = (state: AuthState = {}, action: AuthAction) => { + return authActions.match(action, { SAVE_API_TOKEN: (token: string) => { authService.saveApiToken(token); setServerApiAuthorizationHeader(token); @@ -45,5 +45,3 @@ const authReducer = (state: AuthState = {}, action: AuthAction) => { default: () => state }); }; - -export default authReducer;