asgardeo / asgardeo-auth-react-sdk

To maintain the implementation of Asgardeo React authentication SDK
Apache License 2.0
40 stars 91 forks source link

`isAuthenticated` Returns false even when Signed In Already #143

Closed chaminjay closed 1 year ago

chaminjay commented 2 years ago

Describe the issue: state.isAuthenticated returns false even after signed into the application successfully. It returns true only if signIn() method invoked manually. i.e. clicking the "Login" button again

How to reproduce:

  1. Setup a ReactJs SPA with Asgardeo configs
  2. Sign into the app
  3. Observe the value of isAuthenticated

Expected behavior: isAuthenticated should return true if the user has successfully signed in.

Environment information (Please complete the following information; remove any unnecessary fields) :

yathindrak commented 2 years ago

Got the same issue when the apps get the authorization code and session state. At this point, if we check theisAuthenticated flag, we get false, which is incorrect. This caused an endless loop, as the sdk continuously tries to get the user authenticated.

App type: Create React App Node Version: 16.15.0 OS: macOS pnpm Version: 7.11.0