Skip to content

[refactor] remove useless conditional in Redux/index.js::checkLogin #44

@ortonomy

Description

@ortonomy
if ( c.get('jwt') ) {
    const jwt = c.get('jwt');
    Debug.log('[checkLogin:getCookie] HYDRATESTATE', jwt);
    if ( jwt ) { // this is redundant
      const userDetails = await API.isLoggedIn(jwt);
      return userDetails ? { userDetails: userDetails, jwt: jwt } : { userDetails: null, jwt: null };
    }
  }

rewrite to:

if ( c.get('jwt') ) {
    Debug.log('[checkLogin:getCookie] HYDRATESTATE', c.get('jwt'));
    const userDetails = await API.isLoggedIn(c.get('jwt'));
    return userDetails ? { userDetails: userDetails, jwt: c.get('jwt') } : { userDetails: null, jwt: null };
}   

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions