Buy nowGet update
  • getting started
    • Introduction
    • Quick start
    • Mock server
    • Deployment
    • Package & license
    • Setup
    • Figma
  • theme UI
    • Colors
    • Typography
    • IconsNEW
    • Shadows
    • Css vars
    • Logo
    • Layout
    • Navigation
    • Settings
  • Global
    • Styles
    • Config
    • Components overrides
  • development
    • Routing
    • Subfolder
    • Authentication
      • Jwt
      • Firebase
      • Amplify
      • Supabase
      • Auth0
      • User info
    • Environment variables
    • Api calls
    • Multi language
    • Structure
    • Clean project
    • Dependencies
    • Tailwind
    • Migrate to CRA
    • Credit assets
  • support
    • 🔵 Update
    • 🔴 Faqs & support
    • 🟣 Changelogv7.4.0
© All rights reserved.ContactHome

Get user info

Refactor how user info is accessed based on the authentication method you're using.


Default behavior

By default, the project uses static mocked user data for development:

Before:
import { useMockedUser } from 'src/auth/hooks';
 
const { user } = useMockedUser();
Update to real auth context

To retrieve actual user info based on the selected authentication strategy, update your code like this:

After:
import { useAuthContext } from 'src/auth/hooks';
 
const { user } = useAuthContext();