keycloakify / oidc-spa

Openid connect client for Single Page Applications
https://www.oidc-spa.dev
MIT License
68 stars 7 forks source link

createMockReactOidc ignores isUserInitiallyLoggedIn false parameter #42

Closed jan-chvojka closed 2 hours ago

jan-chvojka commented 6 hours ago

Hi, there seems to be an issue with createMockReactOidc and the isUserInitiallyLoggedIn parameter. The user is logged in even when I pass false to it.

Steps to reproduce:

# Clone the repository
git clone <repo-url>
cd examples/tanstack-router
# Edit examples/tanstack-router/src/oidc.tsx:
# Uncomment the mock section or delete most of it and keep only createMockReactOidc, set isUserInitiallyLoggedIn: false
touch yarn.lock && yarn && yarn dev

Visit the page, and you'll notice that you are logged in even though you shouldn't be. Additionally, you cannot log out.

garronej commented 2 hours ago

Thank you for reporting @jan-chvojka,

I've fixed it. Just published a new version.