Merge branch 'master'
[arvados.git] / src / store / auth / auth-reducer.ts
index e58b2535e6805bf98bd15a32d3f8521698416a25..f6974fd2073be49a5c01fe6677bff22edbc4ae8d 100644 (file)
@@ -6,12 +6,11 @@ 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;
     apiToken?: string;
-};
+}
 
 const authReducer = (state: AuthState = {}, action: AuthAction) => {
     return actions.match(action, {
@@ -39,14 +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,
-                uuid: ud.uuid,
-                ownerUuid: ud.owner_uuid
-            };
+        USER_DETAILS_SUCCESS: (user: User) => {
             authService.saveUser(user);
             return {...state, user};
         },