How to use the strapi-helper-plugin.auth.getUserInfo function in strapi-helper-plugin

To help you get started, we’ve selected a few strapi-helper-plugin examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github strapi / strapi / packages / strapi-admin / admin / src / containers / HomePage / index.js View on Github external
push(
      '/plugins/content-type-builder/models/user&source=users-permissions?modalType=model&settingType=base&actionType=create'
    );
  };
  const hasAlreadyCreatedContentTypes =
    get(
      plugins,
      ['content-manager', 'leftMenuSections', '0', 'links'],
      []
    ).filter(contentType => contentType.isDisplayed === true).length > 1;

  const headerId = hasAlreadyCreatedContentTypes
    ? 'HomePage.greetings'
    : 'app.components.HomePage.welcome';
  const username = get(auth.getUserInfo(), 'username', '');
  const linkProps = hasAlreadyCreatedContentTypes
    ? {
        id: 'app.components.HomePage.button.blog',
        href: 'https://blog.strapi.io/',
        onClick: () => {},
        type: 'blog',
        target: '_blank',
      }
    : {
        id: 'app.components.HomePage.create',
        href: '',
        onClick: handleClick,
        type: 'documentation',
      };

  return (
github strapi / strapi / packages / strapi-admin / admin / src / components / Logout / index.js View on Github external
const handleGoToAdministrator = () => {
    push({
      pathname: '/plugins/content-manager/administrator',
      search: '?source=admin',
    });
  };
  const handleLogout = () => {
    auth.clearAppStorage();
    push('/auth/login');
  };

  return (
    
      
        
          {get(auth.getUserInfo(), 'username')}
          <i alt="{`${isOpen}`}">
        </i><i alt="{`${isOpen}`}">
        
          
            
          
          
            
          
          
            
            <i>
          </i><i>
        </i><i>
      </i></i><i alt="{`${isOpen}`}"><i>
    </i></i>