added format command and added trailing commas to reduce conflicts

This commit is contained in:
dswbx
2025-02-26 20:06:03 +01:00
parent 88b5359f1c
commit 7743f71a11
414 changed files with 3622 additions and 3610 deletions

View File

@@ -30,11 +30,11 @@ export type LoginFormProps = Omit<ComponentPropsWithoutRef<"form">, "onSubmit" |
const validator = new TypeboxValidator();
const schema = Type.Object({
email: Type.String({
pattern: "^[\\w-\\.]+@([\\w-]+\\.)+[\\w-]{2,4}$"
pattern: "^[\\w-\\.]+@([\\w-]+\\.)+[\\w-]{2,4}$",
}),
password: Type.String({
minLength: 8 // @todo: this should be configurable
})
minLength: 8, // @todo: this should be configurable
}),
});
export function AuthForm({
@@ -49,7 +49,7 @@ export function AuthForm({
const basepath = auth?.basepath ?? "/api/auth";
const password = {
action: `${basepath}/password/${action}`,
strategy: auth?.strategies?.password ?? ({ type: "password" } as const)
strategy: auth?.strategies?.password ?? ({ type: "password" } as const),
};
const oauth = transform(
@@ -59,7 +59,7 @@ export function AuthForm({
result[key] = value.config;
}
},
{}
{},
) as Record<string, AppAuthOAuthStrategy>;
const has_oauth = Object.keys(oauth).length > 0;

View File

@@ -15,7 +15,7 @@ export function AuthScreen({
action = "login",
logo,
intro,
formOnly
formOnly,
}: AuthScreenProps) {
const { strategies, basepath, loading } = useAuthStrategies();
const Form = <AuthForm auth={{ basepath, strategies }} method={method} action={action} />;

View File

@@ -20,7 +20,7 @@ export function SocialLink({
action,
method = "POST",
basepath = "/api/auth",
children
children,
}: SocialLinkProps) {
const url = [basepath, provider, action].join("/");

View File

@@ -6,7 +6,7 @@ import { SocialLink } from "./SocialLink";
export const Auth = {
Screen: AuthScreen,
Form: AuthForm,
SocialLink: SocialLink
SocialLink: SocialLink,
};
export { useAuthStrategies };