kinde-auth-react icon indicating copy to clipboard operation
kinde-auth-react copied to clipboard

isLoading remains false in SDK v5.4.1

Open AbdiwakBekele opened this issue 7 months ago • 4 comments

Prerequisites

  • [x] I have searched the repository’s issues and Kinde community to ensure my issue isn’t a duplicate
  • [x] I have checked the latest version of the library to replicate my issue
  • [x] I have read the contributing guidelines
  • [x] I agree to the terms within the code of conduct

Describe the issue

When using the Kinde React SDK v5.4.1 with React 19.1.0, the isLoading flag from useKindeAuth() never switches to true during the auth flow. I tested this by logging the state on initial mount and during state changes. It always stays false.

However, when testing with SDK v4.0.4 and React 18.3.1, isLoading correctly reflects true during the authentication process and behaves as expected.

Library URL

https://github.com/kinde-oss/kinde-auth-react”.

Library version

5.4.1

Operating system(s)

macOS

Operating system version(s)

12.7.6

Further environment details

No response

Reproducible test case URL

No response

Additional information

No response

AbdiwakBekele avatar May 26 '25 20:05 AbdiwakBekele

Hi @AbdiwakBekele I have had a quick look at the code, isLoading defaults to true and is set to false when the auth process is complete.

The events are fired before isLoading is set to false as they happen during the "loading" stage.

Could you elaborate what your expectations are and we can look at updating.

DanielRivers avatar May 28 '25 22:05 DanielRivers

Hi, @DanielRivers Here below I attached two log screenshots,

  • For the first Screenshot (v4.0.4) and it works exactly as you mentioned
  • For the Second Screenshot (v5.4.1) it always remain false. (I have same code structure, just different SDK).

My expectation was that whenever there is a change in the auth flow, the isLoading state would update accordingly, so it could be used to display a loading page or manage any intermediate state until the flow completes successfully. Thanks

Image

Image

AbdiwakBekele avatar May 30 '25 10:05 AbdiwakBekele

Hi, any update on this?

I have the same issue when trying to update 4.0.1. to 5.4.1 and 5.5.0, where the code structure is the same and the SDK version is the only difference (React 18.2.0 in both cases).

Initially tried to update the SDK prompted by support to possibly solve another issue I had, but decided against it, because of the loading state issue.

alex-kupeeva avatar Jun 25 '25 08:06 alex-kupeeva

I reproduced your concern raised 💯 On the current live SDK isLoading indeed will only show up as false as it has been viewed for mostly internal usage during v5 upgrade work. Auth token ping is almost always blazing fast so that even if isLoading would be returning true while auth is being processed, it would be effectively a blink of an eye (mostly under 50ms to ~500ms at worst) with the current auth setup flow. Our immediate suggestion is to use isAuthenticated for your loading state if desired in a meanwhile. Question we have for you is this: how have you been using this flag and what kind of value does it hold functionally for you? @alex-kupeeva @AbdiwakBekele

dtoxvanilla1991 avatar Nov 06 '25 21:11 dtoxvanilla1991