asgardeo / asgardeo-auth-react-sdk

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

When try to check whether user had login to the system when website load State updates infinitely #121

Closed NipunaMarcus closed 1 year ago

NipunaMarcus commented 2 years ago

Describe the issue: When trying to check whether the user had a login to the system when the website State updates infinitely till we get a response back as far as I understood.

Code sample: https://github.com/LSFLK/MedicinesforLK/blob/development/admin-portal/src/App.tsx#L26

This happens when we have selected workers as our storage option. This works fine for other two storage options (localstorage, session storage)

How to reproduce:

Expected behavior: If the user logged in update the state to have authenticated true and loading false. If the user is not logged in redirect the user to the login page.

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

yathindrak commented 2 years ago

The issue reproduced with an app created with create-react-app even without using silent auth check.

Storage mechanism - Web worker Browser - Chrome

https://user-images.githubusercontent.com/32919513/185151655-9df2e5ed-20d2-45f1-908c-29f139b1e875.mp4

pavinduLakshan commented 1 year ago

Closing this issue based on https://github.com/LSFLK/MedicinesforLK/pull/430