bjerkio/oidc-react

I can't exactly logout

durmazoguzhan opened this issue · 1 comments

  • I want to logout and login as another user. I can login, logout, but i login automatically(without open id login page) and i can't enter another user credentials.
  • I see open id login page when app open just first time.
const oidcConfig = {
  authority: 'https://localhost:44365',
  clientId: 'inveshop',
  clientSecret: 'secret',
  redirectUri: 'http://localhost:3000/signin-oidc',
  postLogoutRedirectUri: 'http://localhost:3000/signout-callback-oidc',
  responseType: 'code',
  scope: 'inveshop openid',
  loadUserInfo: true,
  autoSignIn: false
};
<AuthProvider
  {...oidcConfig}
  onSignIn={(user) => {
    dispatch({ type: "user/login", payload: user.profile });
  }}
  onSignOut={() => {
    dispatch({ type: "user/logout" });
  }}
>
<button onClick={() => auth.signOut()}>
  <i className="fa fa-sign-out"></i> Çıkış Yap
</button>
<button onClick={() => auth.signIn()}>
  <i className="fa fa-user"></i>
  Giriş Yap
</button>

How to close session when run the auth.signIn() function?