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

After log out redirect is not working properly. #1515

Open
mohamed-isak opened this issue Feb 13, 2025 · 1 comment
Open

After log out redirect is not working properly. #1515

mohamed-isak opened this issue Feb 13, 2025 · 1 comment

Comments

@mohamed-isak
Copy link

### Issue Description
I'm encountering an issue when calling logout() in @axa-fr/react-oidc. After clicking the logout button, I receive the following error

### 📌 Error Message:

Image

### Expected Behavior:
After logging out, the user should be redirected to the login screen (https://localhost:3000), but this is not happening.

### 🛠 Code Implementation

const { logout } = useOidc('default');

  const handleLogout = async () => {
    try {
       logout();
      onConfirm();
    } catch (error) {
      console.error("Logout error:", error);
    }
  }

### OIDC Configuration

export const configurationIdentityServerWithoutServiceWorker = {
  client_id: env.REACT_APP_CLIENT_ID,
  redirect_uri: window.location.origin + '/callback',
  silent_redirect_uri: window.location.origin + '/silent_callback',
  silent_login_uri: window.location.origin + '/silent_callback', 
  scope: IDENTITY_SERVER_SCOPE,
  authority: env.REACT_APP_IDENTITY_SERVER_URL,
  refresh_time_before_tokens_expiration_in_second: 40,
  storage: localStorage,
  //
  preload_user_info: true,
  logLevel: 2,
};
@guillaume-chervet
Copy link
Contributor

Hi @mohamed-isak , thank you for your issue.

Does your OIDC server support logout? Logout require "oidc" scope. Which scope do you have inside IDENTITY_SERVER_SCOPE ?

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

2 participants