Crema React
v-1
v-1
  • About Crema(CRA)
  • Product Overview
  • Folder Structure
  • Installation
    • Pre-Requisites
    • Installing Crema
  • Default Route
  • Customization
    • Template Style
    • Template Mode
    • Template and Sidebar Color
    • Tempate Direction
    • Navigation Style
    • Footer
    • Footer Type
    • Route Transition
  • Multi-Lingual Support
    • Changing Language
    • Adding New Language
  • Sidebar Menu
    • Adding New Menu
  • Route Protection
  • Loggedin User
  • Axios Setup
  • Package.json
  • GitHub Access
  • Slack Community
  • FAQ
  • CRA-SSR
    • About CRA+SSR
    • Installation
    • Folder Structure
    • Route Protection
    • Deploy to server
  • Next.js
    • About Next.JS
    • Installation
    • Folder Structure
    • Deploy to server
  • Next.Js + TypeScript
    • About Next.js + Typescript
    • Installation
    • Folder Structure
    • Deploy to server
  • CRA + TypeScript
    • About CRA + TypeScript
  • Tailwind CSS
    • About Tailwind CSS
  • Styled Component
    • About Styled Component
  • Servers
    • Python
    • Mongoose
    • Laravel
Powered by GitBook
On this page

Was this helpful?

Loggedin User

To get the data of logged in user wherever you need, simply write one line code i.e.

const user = useAuthUser();

In the starter template, to get auth user, call useAuthUser hooks. it will return the current logged in user.

const [user, authType] = useAuthUser();

In the source, there are multiple authenticate methods like AWS, firebase, Auth0, and JWT-auth. then authType is used to check which logout method will call for logged in user.

You have to import useAuthUser from

src/@crema/utility/AppHooks.js

Last updated 4 years ago

Was this helpful?