Features

How to use?

Currently implemented and fully supported.

import { useAuth } from '@/context/SupabaseProvider';

const {
  user,
  session,
  initialized,
  signOut,
  signIn,
  signUp,
  sendMagicLink,
  signInWithGoogle,
  signInWithApple,
  createSessionFromUrl,
  handleShowPassword,
  isLoading,
  error,
  isAuthenticated,
  showPassword,
  handleError,
  sendNewPasswordLink,
  setNewPassword,
} = useAuth();

Auth Functions

Props

ValueTypeDescription
userUserMetaData | nullContains current authenticated user information
sessionSession | nullContains active session information
initializedbooleanIndicates if auth state has been initialized
signOut() => Promise<void>Signs out the current user
signIn(email: string, password: string) => Promise<void>Signs in user with email/password
signUp(email: string, password: string) => Promise<void>Creates a new user account
sendMagicLink(email: string) => Promise<void>Sends a magic link to user’s email
signInWithGoogle() => Promise<void>Initiates Google OAuth sign in
signInWithApple() => Promise<void>Initiates Apple OAuth sign in
createSessionFromUrl(url: string) => Promise<void>Creates session from URL
handleShowPassword() => voidToggles password visibility
isLoadingbooleanIndicates if auth operation is in progress
errorError | nullContains error information if any
isAuthenticatedbooleanIndicates if user is authenticated
showPasswordbooleanControls password visibility state
handleError`(error: AuthErrorError) => void`Handles auth-related errors
sendNewPasswordLink(email: string) => Promise<void>Sends password reset link
setNewPassword(password: string) => Promise<void>Sets new password