prettier fix

This commit is contained in:
Danel Kungla
2025-09-19 17:22:36 +03:00
parent efa94b3322
commit 0c2cfe6d18
509 changed files with 17988 additions and 9920 deletions

View File

@@ -1,5 +1,7 @@
import type { Provider } from '@supabase/supabase-js';
import { z } from 'zod';
import { createAuthProvidersService } from './auth-providers.service';
const providers: z.ZodType<Provider> = getProviders();
@@ -10,8 +12,12 @@ const DynamicAuthConfigSchema = z.object({
magicLink: z.boolean().describe('Enable magic link authentication.'),
oAuth: providers.array(),
}),
displayTermsCheckbox: z.boolean().describe('Whether to display the terms checkbox during sign-up.'),
isMailerAutoconfirmEnabled: z.boolean().describe('Whether Supabase sends confirmation email automatically.'),
displayTermsCheckbox: z
.boolean()
.describe('Whether to display the terms checkbox during sign-up.'),
isMailerAutoconfirmEnabled: z
.boolean()
.describe('Whether Supabase sends confirmation email automatically.'),
});
export type DynamicAuthConfig = {
@@ -22,7 +28,7 @@ export type DynamicAuthConfig = {
};
displayTermsCheckbox: boolean | undefined;
isMailerAutoconfirmEnabled: boolean;
}
};
export async function getDynamicAuthConfig() {
const authService = createAuthProvidersService();
@@ -57,10 +63,13 @@ export async function getCachedAuthConfig() {
if (typeof window !== 'undefined') {
try {
sessionStorage.setItem('auth-config', JSON.stringify({
data: config,
timestamp: Date.now(),
}));
sessionStorage.setItem(
'auth-config',
JSON.stringify({
data: config,
timestamp: Date.now(),
}),
);
} catch (error) {
console.warn('Failed to cache auth config:', error);
}
@@ -73,7 +82,9 @@ export async function getServerAuthConfig() {
return getDynamicAuthConfig();
}
export async function isProviderEnabled(provider: 'password' | 'magicLink' | Provider): Promise<boolean> {
export async function isProviderEnabled(
provider: 'password' | 'magicLink' | Provider,
): Promise<boolean> {
const authService = createAuthProvidersService();
const settings = await authService.fetchAuthSettings();