Skip to content

Commit

Permalink
feat: update session when updating user (#617)
Browse files Browse the repository at this point in the history
* feat: update session when updating user

* Add changeset

---------

Co-authored-by: Andrew Smith <[email protected]>
  • Loading branch information
pitzcarraldo and silentworks authored Aug 2, 2023
1 parent 002e6f9 commit 4a7bbfe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/shy-penguins-bathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@supabase/auth-helpers-react': patch
---

Update session when updating user
2 changes: 1 addition & 1 deletion packages/react/src/components/SessionContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export const SessionContextProvider = ({
const {
data: { subscription }
} = supabaseClient.auth.onAuthStateChange((event, session) => {
if (session && (event === 'SIGNED_IN' || event === 'TOKEN_REFRESHED')) {
if (session && (event === 'SIGNED_IN' || event === 'TOKEN_REFRESHED' || event === 'USER_UPDATED')) {
setSession(session);
}

Expand Down

0 comments on commit 4a7bbfe

Please sign in to comment.