This commit accomplishes a few modifications including the elimination of `use-toast.tsx` due to redundancy. The authentication methods in `personal-accounts-server-actions.ts` were refactored to improve service integration and data handling. Additionally, UI components were updated for better readability and clarity. Cascading deletion was enabled in the `schema.sql` file for 'invited_by' reference.
52 lines
901 B
TypeScript
52 lines
901 B
TypeScript
import type { Provider } from '@supabase/gotrue-js';
|
|
|
|
import { z } from 'zod';
|
|
|
|
const providers: z.ZodType<Provider> = getProviders();
|
|
|
|
const AuthConfigSchema = z.object({
|
|
providers: z.object({
|
|
password: z.boolean(),
|
|
magicLink: z.boolean(),
|
|
oAuth: providers.array(),
|
|
}),
|
|
});
|
|
|
|
const authConfig = AuthConfigSchema.parse({
|
|
// NB: Enable the providers below in the Supabase Console
|
|
// in your production project
|
|
providers: {
|
|
password: true,
|
|
magicLink: false,
|
|
oAuth: ['google'],
|
|
},
|
|
});
|
|
|
|
export default authConfig;
|
|
|
|
function getProviders() {
|
|
return z.enum([
|
|
'apple',
|
|
'azure',
|
|
'bitbucket',
|
|
'discord',
|
|
'facebook',
|
|
'figma',
|
|
'github',
|
|
'gitlab',
|
|
'google',
|
|
'kakao',
|
|
'keycloak',
|
|
'linkedin',
|
|
'linkedin_oidc',
|
|
'notion',
|
|
'slack',
|
|
'spotify',
|
|
'twitch',
|
|
'twitter',
|
|
'workos',
|
|
'zoom',
|
|
'fly',
|
|
]);
|
|
}
|