quivr/frontend/lib/hooks/useAuthModes.ts

14 lines
509 B
TypeScript
Raw Normal View History

// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
export const useAuthModes = () => {
const authModes = process.env.NEXT_PUBLIC_AUTH_MODES?.split(",") ?? [
"password",
];
console.log('Environment Variable NEXT_PUBLIC_AUTH_MODES:', process.env.NEXT_PUBLIC_AUTH_MODES);
console.log('authModes:', authModes);
return {
magicLink: authModes.includes("magic_link"),
password: authModes.includes("password"),
googleSso: authModes.includes("google_sso"),
};
};