Skip to content

Commit

Permalink
fix: token refresh loop (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
thorwebdev authored May 9, 2022
1 parent 39c8a06 commit dceca97
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/react/components/UserProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export const UserProvider = (props: Props) => {
useEffect(() => {
const { data: authListener } = supabaseClient.auth.onAuthStateChange(
async (event, session) => {
if (event === 'TOKEN_REFRESHED') return; // ignore this as we're refreshing tokens server-side.
setIsLoading(true);
// Forward session from client to server where it is set in a Cookie.
// NOTE: this will eventually be removed when the Cookie can be set differently.
Expand Down

0 comments on commit dceca97

Please sign in to comment.