import type { AppAuthOAuthStrategy } from "auth/auth-schema"; import { ucFirstAllSnakeToPascalWithSpaces } from "core/utils"; import { transform } from "lodash-es"; import { useAuthStrategies } from "ui/client/schema/auth/use-auth"; import { Button } from "ui/components/buttons/Button"; import { Logo } from "ui/components/display/Logo"; import { Link } from "ui/components/wouter/Link"; import { useBrowserTitle } from "ui/hooks/use-browser-title"; import { LoginForm } from "ui/modules/auth/LoginForm"; import * as AppShell from "../../layouts/AppShell/AppShell"; export function AuthLogin() { useBrowserTitle(["Login"]); const { strategies, basepath, loading } = useAuthStrategies(); const oauth = transform( strategies ?? {}, (result, value, key) => { if (value.type !== "password") { result[key] = value.config; } }, {} ) as Record; //console.log("oauth", oauth, strategies); return ( {!loading && (

Sign in to your admin panel

Enter your credentials below to get access.

{Object.keys(oauth).length > 0 && ( <> {Object.entries(oauth)?.map(([name, oauth], key) => (
))}
or
)} {/*Logout*/}
)} ); }