Skip to content

Commit

Permalink
fix: Remove getUser in callback handler (#461)
Browse files Browse the repository at this point in the history
Makes state available after `signinCallback` to onSignIn event

fixes #447 

Co-authored-by: Edward Sparkes <sparkes.e@cambridgeassessment.org.uk>
  • Loading branch information
ed-sparkes and Edward Sparkes authored Feb 3, 2021
1 parent cd34137 commit 7abb83d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/AuthContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ export const AuthProvider: FC<AuthProviderProps> = ({
* Check if the user is returning back from OIDC.
*/
if (hasCodeInUrl(location)) {
await userManager.signinCallback();
const user = await userManager.getUser();
const user = await userManager.signinCallback();
setUserData(user);
onSignIn && onSignIn(user);
return;
Expand Down

0 comments on commit 7abb83d

Please sign in to comment.