Skip to content

isLoggedIn set to false after token is refreshed #82

@todda00

Description

@todda00

isLoggedIn set to false after token is refreshed

Description

After a token is refreshed (via setting shouldAutoRefresh = true) the isLoggedIn is switched to false and does not return to true unless the page is refreshed.

Affects package

@fusionauth/react-sdk

Affects versions

@fusionauth/react-sdk@2.1.0 only version attempted

Steps to reproduce

Steps to reproduce the behavior:

  1. Set a low JWT expiry expiration for testing (I used 60 seconds) at the FA server
  2. Ensure shouldAutoRefresh = true in the props to FusionAuthProvider
  3. Create a component somewhere under FusionAuthProvider with a hook to watch the isLoggedIn value.
const Component = () => {
  const { isLoggedIn } = useFusionAuth();

  useEffect(() => {
    console.log({ isLoggedIn });
  }, [isLoggedIn]);

  return null;
}

Once the token is refreshed (within 60 seconds) the isLoggedIn switches to false and does not go back to true.

Expected behavior

isLoggedIn remains true

Screenshots

If applicable, add screenshots to help explain your problem.

Platform

(Please complete the following information)

  • Device: Desktop
  • OS: MacOS
  • Browser + version Chrome 124

Community guidelines

All issues filed in this repository must abide by the FusionAuth community guidelines.

Metadata

Metadata

Assignees

Labels

AngularChalkDXReactSDK Corerelating to the framework-agnostic core of the SDKsVuebugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions