mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-19 05:46:04 +00:00
added format command and added trailing commas to reduce conflicts
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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} />;
|
||||
|
||||
@@ -20,7 +20,7 @@ export function SocialLink({
|
||||
action,
|
||||
method = "POST",
|
||||
basepath = "/api/auth",
|
||||
children
|
||||
children,
|
||||
}: SocialLinkProps) {
|
||||
const url = [basepath, provider, action].join("/");
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import { SocialLink } from "./SocialLink";
|
||||
export const Auth = {
|
||||
Screen: AuthScreen,
|
||||
Form: AuthForm,
|
||||
SocialLink: SocialLink
|
||||
SocialLink: SocialLink,
|
||||
};
|
||||
|
||||
export { useAuthStrategies };
|
||||
|
||||
Reference in New Issue
Block a user