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

Add compatibility with Ionic React #980

Closed
TalaatHarb opened this issue Mar 19, 2023 · 3 comments · Fixed by #982
Closed

Add compatibility with Ionic React #980

TalaatHarb opened this issue Mar 19, 2023 · 3 comments · Fixed by #982

Comments

@TalaatHarb
Copy link

This is a feature request, of adding Basic compatibility with Ionic React,
Currently it almost works, as it does the redirect for the authority and receives the token and saves it storage but it keeps looping and refreshing the page after that which is a shame.

Steps to reproduce:

  • build a new Ionic React app by using the the ionic wizard 'ionic start'
  • install oidc-react
  • add oidc config as normal react project with a valid authority and client id and redirect_uri = 'http://localhost:8100'
  • start the application and observe looping behavior 'ionic serve'
@jamesdh
Copy link
Contributor

jamesdh commented Mar 20, 2023

@TalaatHarb this may not be related to Ionic specifically. This might be a bug I introduced last Friday.

Are you using autoSignIn or do you have it disabled by chance?

@TalaatHarb
Copy link
Author

TalaatHarb commented Mar 20, 2023

I have been using default configuration as mentioned in the getting started guide
so basically:

const oidcConfig = {
  onSignIn: () => {
    // Redirect?
  },
  authority: 'https://oidc.io/oauth',
  clientId: 'this-is-a-client-id',
  redirectUri: 'https://my-app.com/'
};

nothing fancy,
it might be the way routing is handled in Ionic or it might be the specific authority I used (keycloak) because the loop the application got stuck in included calling /openid-configuration end point

However using the same authority in a normal create-react-app template didn't cause that issue

@jamesdh
Copy link
Contributor

jamesdh commented Mar 20, 2023

Yea, I'm pretty sure this is a bug I introduced. Looking into it now.

jamesdh added a commit to jamesdh/oidc-react that referenced this issue Mar 21, 2023
jamesdh added a commit that referenced this issue Mar 21, 2023
…r is signed out (#982)

* fix: isLoading should be set to false when the primary useEffect completes

Fixes #981

* fix: dont set refreshed user unless mounted

Possibly fixes #980 but doubtful

* test: finish rendering before makign assertions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants