nuxt-supabase-team-auth
Version:
Drop-in Nuxt 3 module for team-based authentication with Supabase
63 lines (60 loc) • 1.64 kB
text/typescript
import { NuxtModule } from '@nuxt/schema';
import { PasswordPolicy } from '../dist/runtime/types/password-policy.js';
interface ModuleOptions {
/**
* Supabase project URL
*/
supabaseUrl?: string;
/**
* Supabase anon key
*/
supabaseKey?: string;
/**
* Redirect URL after authentication
*/
redirectTo?: string;
/**
* Login page path (where unauthenticated users are redirected)
*/
loginPage?: string;
/**
* Additional routes to exclude from authentication (beyond defaults)
*/
publicRoutes?: string[];
/**
* Routes that require authentication (if specified, ONLY these routes will be protected)
* If not specified, all routes except publicRoutes will be protected
*/
protectedRoutes?: string[];
/**
* Default protection mode: 'protected' (default) or 'public'
* - 'protected': All routes protected except those in publicRoutes
* - 'public': All routes public except those in protectedRoutes
*/
defaultProtection?: 'protected' | 'public';
/**
* Custom email templates
*/
emailTemplates?: {
invite?: string;
welcome?: string;
};
/**
* Social authentication providers configuration
*/
socialProviders?: {
/**
* Google OAuth provider configuration
*/
google?: {
enabled?: boolean;
};
};
/**
* Password policy configuration
*/
passwordPolicy?: PasswordPolicy;
}
declare const module: NuxtModule<ModuleOptions>;
export { module as default };
export type { ModuleOptions };