title: TypeError: user.name is undefined since I added reducers
body: <p>The problem I'm facing is related with the reducers creation in order to render user.name and user.email on a styled Header.</p>
  <p>The code for the auth reducers is the following:</p>
  <pre><code>    user: &quot;&quot;,
      isLogged: false,
      isAdmin: false
  }
  
  
  const authReducer = (state = initialState, action) =&gt; {
      switch(action.type){
          case ACTIONS.LOGIN:
              return {
                  ...state,
                  isLogged: true
              }
          case ACTIONS.GET_USER:
          return {
              ...state,
              user: action.payload.user, //
              isAdmin: action.payload.isAdmin
          }
          default:
              return state
      }
  }
  
  export default authReducer
  
  </code></pre>
  <p>And then when I'm trying to use it on the Header component, that is coded as follows:</p>
  <pre><code>const userLink = () =&gt; {
          return &lt;li className=&quot;drop-nav&quot;&gt;
              &lt;Link to=&quot;/&quot; className&gt;
              &lt;i className=&quot;fas fa-user-circle&quot;&gt;&lt;/i&gt;
                  Bienvenido(a) {user.name}
                  &lt;i className=&quot;fas fa-angle-down&quot;&gt;&lt;/i&gt;
                  {console.log(user.name)}
                  &lt;/Link&gt;
                  &lt;ul className=&quot;dropdown&quot;&gt;
                      &lt;li&gt;&lt;Link to=&quot;/profile&quot;&gt;Perfil&lt;/Link&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;Link to=&quot;/logout&quot; onClick={handleLogout}&gt;Cerrar Sesión&lt;/Link&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;Link to=&quot;/profile_admin&quot;&gt;Admin&lt;/Link&gt;&lt;/li&gt;
                  &lt;/ul&gt;
          &lt;/li&gt;
      }
  </code></pre>
  <p>The thing that happens is that actually my code reads user.user.name (like an index from an array) but whenever I try to reload the page it shows this message:</p>
  <pre><code>TypeError: auth.user.user is undefined
  
  Header
  
    12 | 
    13 | const {user, isLogged} = auth
    14 | 
  &gt; 15 | console.log(auth.user.user.name);
       | ^  16 | 
    17 | const handleLogout = async () =&gt; {
    18 |     try{
  
  </code></pre>
  <p>src/components/header/Header.js:15</p>