Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UserData user info is always undefined #38

Open
VGamezz19 opened this issue Dec 17, 2020 · 0 comments
Open

UserData user info is always undefined #38

VGamezz19 opened this issue Dec 17, 2020 · 0 comments

Comments

@VGamezz19
Copy link

VGamezz19 commented Dec 17, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant