X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/040d25dbcc9ec46c4c21c945ccf02dcf1bf44c26..1a9eb2261e6030ba78078e2a206bad27653f2475:/src/store/auth/auth-reducer.ts diff --git a/src/store/auth/auth-reducer.ts b/src/store/auth/auth-reducer.ts index 3fd70442..f6974fd2 100644 --- a/src/store/auth/auth-reducer.ts +++ b/src/store/auth/auth-reducer.ts @@ -6,7 +6,6 @@ import actions, { AuthAction } from "./auth-action"; import { User } from "../../models/user"; import { authService } from "../../services/services"; import { removeServerApiAuthorizationHeader, setServerApiAuthorizationHeader } from "../../common/api/server-api"; -import { UserDetailsResponse } from "../../services/auth-service/auth-service"; export interface AuthState { user?: User; @@ -39,12 +38,7 @@ const authReducer = (state: AuthState = {}, action: AuthAction) => { authService.logout(); return {...state, apiToken: undefined}; }, - USER_DETAILS_SUCCESS: (ud: UserDetailsResponse) => { - const user = { - email: ud.email, - firstName: ud.first_name, - lastName: ud.last_name - }; + USER_DETAILS_SUCCESS: (user: User) => { authService.saveUser(user); return {...state, user}; },