X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/5320327aa99710bb1cd1ce090fcb8e2b1d6de0da..b863f7aaab7112a32c7f9b1e7a0299c4266df2f5:/src/store/auth/auth-reducer.ts diff --git a/src/store/auth/auth-reducer.ts b/src/store/auth/auth-reducer.ts index c5a485648f..57a17ae53c 100644 --- a/src/store/auth/auth-reducer.ts +++ b/src/store/auth/auth-reducer.ts @@ -2,10 +2,11 @@ // // SPDX-License-Identifier: AGPL-3.0 -import actions, { AuthAction, UserDetailsResponse } from "./auth-action"; +import actions, { AuthAction } from "./auth-action"; import { User } from "../../models/user"; import { authService } from "../../services/services"; -import { removeServerApiAuthorizationHeader, setServerApiAuthorizationHeader } from "../../common/server-api"; +import { removeServerApiAuthorizationHeader, setServerApiAuthorizationHeader } from "../../common/api/server-api"; +import { UserDetailsResponse } from "../../services/auth-service/auth-service"; export interface AuthState { user?: User; @@ -22,6 +23,9 @@ const authReducer = (state: AuthState = {}, action: AuthAction) => { INIT: () => { const user = authService.getUser(); const token = authService.getApiToken(); + if (token) { + setServerApiAuthorizationHeader(token); + } return {user, apiToken: token}; }, LOGIN: () => {