Skip to content

UserData user info is always undefined #38

Description

@VGamezz19

I simply try to catch user information from const { user, userManager }= useContext(UserData); but they are always null :(

Console Log Output

{user: null, userManager: null, signOut: ƒ}

Is there any configuration that I have missed related on UserData context?

There you have my user manager config:

export const METADATA_OIDC = {
  issuer: IDENTITY_URL,
  jwks_uri: `${IDENTITY_URL}/.well-known/openid-configuration/jwks`,
  authorization_endpoint: `${IDENTITY_URL}/connect/authorize`,
  token_endpoint: `${IDENTITY_URL}/connect/token`,
  userinfo_endpoint: `${IDENTITY_URL}/connect/userinfo`,
  end_session_endpoint: `${IDENTITY_URL}/connect/endsession`,
  check_session_iframe: `${IDENTITY_URL}/connect/checksession`,
  revocation_endpoint: `${IDENTITY_URL}/connect/revocation`,
  introspection_endpoint: `${IDENTITY_URL}/connect/introspect`
};

export const IDENTITY_CONFIG = {
  authority: IDENTITY_URL,
  client_id: 'jscmms',
  redirect_uri: `${HOST_URL}/callback`,
  login: `${IDENTITY_URL}/login`,
  automaticSilentRenew: true,
  filterProtocolClaims: true,
  loadUserInfo: true,
  silent_redirect_uri: `${HOST_URL}/renew`,
  post_logout_redirect_uri: `${HOST_URL}/`,
  response_type: 'token id_token',
  scope: 'openid profile'
};

export const userManager = makeUserManager({
  ...IDENTITY_CONFIG,
  metadata: {
    ...METADATA_OIDC
  }
});

There you have how I implement it

  return makeAuthenticator({
    userManager,
    signinArgs: {
      extraQueryParams: {
        site: SITE_ID
      }
    }
  })(Component);

Tnx for your time

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions