Crema React
v-4 Nextjs
v-4 Nextjs
  • About Crema Next.js
  • Overview
    • Crema Next.js Overview
    • Folder Structure
      • @crema
      • app
      • assets
      • modules
      • style
    • Package.json
    • GitHub Access
    • Slack Community
    • Figma File
  • Decelopment
    • Installation
    • Route Management
    • Auth User
    • Authentication Methods
    • Axios Config
      • APIs Calling
    • Multilingual
  • MUI
    • Theme Color
    • Sidebar Configuration
    • Navigation Style
    • Footer Configuration
    • Template Direction
    • Template Mode
  • FAQ
  • ANTD
    • About Crema Ant
    • Style Framework
  • Crema V-3 Doc
  • Servers
    • Python
    • Laravel
    • Mongoose
  • Credits
Powered by GitBook
On this page

Was this helpful?

  1. Decelopment

Auth User

In the Crema if you want to get the currently authenticated user. You need to call the useAuthUser hook and you will get the auth user like below.

In the Crema, if you want to get the currently authenticated user. You need to call the useAuthUser hook and you will get the auth user like below.

import { useAuthUser } from '@crema/hooks/AuthHooks';

const {user, isAuthenticated, isLoading} = useAuthUser();

user             // authenticated user object 
isLoading        // authentication is in progress
isAuthenticated  // denote the user auth state 

Last updated 1 year ago

Was this helpful?