mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-13 00:03:27 +10:00
fix: auth layout if email is the only auth provider
This commit is contained in:
@ -14,14 +14,14 @@ const authRoutes = [{ path: "/auth/login" }, { path: "/auth/register" }];
|
||||
|
||||
export const AuthLayout = () => {
|
||||
const location = useLocation();
|
||||
|
||||
const { providers } = useAuthProviders();
|
||||
const emailAuthDisabled = !providers || !providers.includes("email");
|
||||
|
||||
const isAuthRoute = useMemo(() => matchRoutes(authRoutes, location) !== null, [location]);
|
||||
|
||||
if (!providers) return null;
|
||||
|
||||
// Condition (providers.length === 1) hides the divider if providers[] includes only "email"
|
||||
const hideDivider = !providers.includes("email") || providers.length === 1;
|
||||
|
||||
return (
|
||||
<div className="flex h-screen w-screen">
|
||||
<div className="relative flex w-full flex-col justify-center gap-y-8 px-12 sm:mx-auto sm:basis-[420px] sm:px-0 lg:basis-[480px] lg:px-12">
|
||||
@ -40,7 +40,7 @@ export const AuthLayout = () => {
|
||||
|
||||
{isAuthRoute && (
|
||||
<>
|
||||
<div className={cn("flex items-center gap-x-4", emailAuthDisabled && "hidden")}>
|
||||
<div className={cn("flex items-center gap-x-4", hideDivider && "hidden")}>
|
||||
<hr className="flex-1" />
|
||||
<span className="text-xs font-medium">
|
||||
{t({
|
||||
|
||||
@ -17,7 +17,7 @@ import { Config } from "../config/schema";
|
||||
|
||||
type ImageUploadType = "pictures" | "previews";
|
||||
type DocumentUploadType = "resumes";
|
||||
type UploadType = ImageUploadType | DocumentUploadType;
|
||||
export type UploadType = ImageUploadType | DocumentUploadType;
|
||||
|
||||
const PUBLIC_ACCESS_POLICY = {
|
||||
Version: "2012-10-17",
|
||||
|
||||
Reference in New Issue
Block a user