useAuthController
useAuthController
Section titled “useAuthController”For state and operations regarding authentication.
The props provided by this hook are:
userThe Firebase user currently logged in or nullauthProviderErrorError dispatched by the auth providerauthLoadingIs the login process ongoingloginSkippedIs the login skippednotAllowedErrorThe current user was not allowed accessskipLogin()Skip loginsignOut()Sign out
Example:
import React from "react";import { useAuthController } from "@firecms/core";
export function ExampleCMSView() {
const authController = useAuthController();
return ( authController.user ? <div>Logged in as {authController.user.displayName}</div> : <div>You are not logged in</div> );}