Skip to content

Conversation

@crhistianramirez
Copy link
Contributor

includes redirecting users to the identity provider and handling the response

@crhistianramirez
Copy link
Contributor Author

crhistianramirez commented Jul 31, 2025

There is a draft PR here that shows how these changes would be incorporated into the oc-accelerator. Whoever reviews this PR can use this to validate changes.

includes redirecting users to the identity provider and handling the response
* @returns An object with:
* - run: the deduplicated function
* - isRunning: boolean indicating whether the function is currently executing
*/
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to use this with verifyToken to solve a race condition I was facing where a second invocation thought I wasn't logged in even though I was.

Tokens.RemoveRefreshToken();
setIsAuthenticated(false);
setIsLoggedIn(false);
setToken(undefined);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was part of the troubleshooting I was doing with the race condition bug. It probably doesn't matter but setIsAuthenticated(false) will trigger verifyToken which relies on the values of the token so it makes sense that we clear out the tokens here first before setting isAuthenticated to false

Copy link
Collaborator

@erincdustin erincdustin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great, validated with the accelerator branch

@erincdustin erincdustin merged commit d71b701 into ordercloud-api:main Aug 4, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants