How to use the @commercetools-frontend/constants.LOGOUT_REASONS.USER function in @commercetools-frontend/constants

To help you get started, we’ve selected a few @commercetools-frontend/constants 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 commercetools / merchant-center-application-kit / packages / application-shell / src / components / user-settings-menu / user-settings-menu.js View on Github external
data-track-component="Navigation-Support-links"
          data-track-event="click"
          data-track-label="support_textlink"
          onClick={props.downshiftProps.toggleMenu}
        >
          <menuitem>
            
              
            
          </menuitem>
        
        <menuitem>
        <a data-test="logout-button" href="{`/logout?reason=${LOGOUT_REASONS.USER}`}" for="">
          <menuitem tabindex="0">
            
              
            
          </menuitem>
        </a>
      
    
  );
};
UserSettingsMenuBody.displayName = 'UserSettingsMenuBody';</menuitem>
github commercetools / merchant-center-application-kit / cypress / integration / playground / application-shell.js View on Github external
it('should log out with reason "user"', () => {
    cy.login({ redirectToUri: URL_STATE_MACHINES });
    cy.findByLabelText('open menu').click();
    cy.findByText('Logout').click();
    const queryParams = encode({
      reason: LOGOUT_REASONS.USER,
    });
    cy.url().should('include', `/logout?${queryParams}`);
    cy.findByText('This is the logout page for local development.').should(
      'exist'
    );
  });
  describe('when going to an unknown route', () => {
github commercetools / merchant-center-application-kit / packages / application-shell / src / components / login / login.js View on Github external
if (!error) return null;

    switch (error) {
      case LOGOUT_REASONS.NO_PROJECTS: {
        const link = (
          <a href="{`${this.props.adminCenterUrl}/login`}">
            
          </a>
        );
        return (
          
            
          
        );
      }
      case LOGOUT_REASONS.USER:
        return (
          
            
          
        );
      case LOGOUT_REASONS.UNAUTHORIZED:
        return (
          
            
          
        );
      case LOGOUT_REASONS.INVALID:
        return (
github commercetools / merchant-center-application-kit / packages / application-shell / src / components / quick-access / create-commands.js View on Github external
id: 'go/account-profile',
      text: intl.formatMessage(messages.openMyProfile),
      keywords: ['Go to user account', 'Go to profile', 'Open profile'],
      action: { type: 'go', to: `/account/profile` },
    },
    {
      id: 'go/privacy-policy',
      text: intl.formatMessage(messages.showPrivacyPolicy),
      keywords: ['Open Privacy Policy'],
      action: { type: 'go', to: 'https://commercetools.com/privacy#suppliers' },
    },
    {
      id: 'go/logout',
      text: intl.formatMessage(messages.logout),
      keywords: ['Sign out'],
      action: { type: 'go', to: `/logout?reason=${LOGOUT_REASONS.USER}` },
    },
    {
      id: 'go/manage-projects',
      text: intl.formatMessage(messages.openManageProjects),
      keywords: [
        'Go to manage projects',
        'Go to projects',
        'Open projects list',
      ],
      action: { type: 'go', to: `/account/projects` },
    },
    {
      id: 'go/manage-organizations',
      text: intl.formatMessage(messages.openManageOrganizations),
      keywords: [
        'Go to manage organizations',

@commercetools-frontend/constants

Shared constants for MC applications

MIT
Latest version published 3 days ago

Package Health Score

87 / 100
Full package analysis