Home / Function/ useOnLogout() — supabase Function Reference

useOnLogout() — supabase Function Reference

Architecture documentation for the useOnLogout() function in userAuth.ts from the supabase codebase.

Entity Profile

Dependency Diagram

graph TD
  7adcb7b1_4d74_cd11_f824_1b19f1104b6b["useOnLogout()"]
  08f7c38c_8226_671b_6486_442d9a88891a["ProjectConfigVariablesInternal()"]
  08f7c38c_8226_671b_6486_442d9a88891a -->|calls| 7adcb7b1_4d74_cd11_f824_1b19f1104b6b
  720bceec_6be4_1129_0778_67f808de3cf8["SignOutHandler()"]
  720bceec_6be4_1129_0778_67f808de3cf8 -->|calls| 7adcb7b1_4d74_cd11_f824_1b19f1104b6b
  style 7adcb7b1_4d74_cd11_f824_1b19f1104b6b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/docs/lib/userAuth.ts lines 22–36

export function useOnLogout(callback: () => void) {
  useEffect(() => {
    const {
      data: {
        subscription: { unsubscribe },
      },
    } = auth.onAuthStateChange((event) => {
      if (event === 'SIGNED_OUT') {
        callback()
      }
    })

    return unsubscribe
  }, [callback])
}

Subdomains

Frequently Asked Questions

What does useOnLogout() do?
useOnLogout() is a function in the supabase codebase.
What calls useOnLogout()?
useOnLogout() is called by 2 function(s): ProjectConfigVariablesInternal, SignOutHandler.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free