Just Auth Docs
  • JustAuth
  • Getting Started with JustAuth
  • Integration
    • Initialization
    • Using the useJustAuth Hook
    • Opening the Auth Modal
    • Checking Authentication Status
    • Exporting Private Key
    • Logging Out
    • Signing Messages
    • Signing Transactions
Powered by GitBook
On this page
  • Overview
  • How to Use
  • Parameters
  • Example
  1. Integration

Checking Authentication Status

Overview

The isAuthenticated boolean allows you to check if a user is logged in.

How to Use

  1. Destructure the boolean from the hook:

    const { isAuthenticated } = useJustAuth();

Parameters

  • No parameters are required for this function.

Example

const { isAuthenticated } = useJustAuth();

if (isAuthenticated) {
   console.log("User is logged in");
} else {
   console.log("User is not logged in");
}
PreviousOpening the Auth ModalNextExporting Private Key

Last updated 8 months ago