Sposta l'autenticazione da Supabase a PocketBase
Login Google via PocketBase invece che Supabase Auth: nuovi client in src/integrations/pocketbase/ (browser, server con superuser, attacher del bearer token per le server function). Il ruolo admin/user vive ora come campo diretto sul record utente PocketBase invece che nella tabella separata user_roles, quindi ruoli.ts e la verifica in auth-route.server.ts non hanno più bisogno di una query aggiuntiva. requireSupabaseAuth/auth-middleware.ts non viene riportato: non era importato da nessun file, era codice morto. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
+2
-2
@@ -1,7 +1,7 @@
|
||||
import { createStart, createCsrfMiddleware, createMiddleware } from "@tanstack/react-start";
|
||||
|
||||
import { renderErrorPage } from "./lib/error-page";
|
||||
import { attachSupabaseAuth } from "@/integrations/supabase/auth-attacher";
|
||||
import { attachPocketBaseAuth } from "@/integrations/pocketbase/auth-attacher";
|
||||
|
||||
const errorMiddleware = createMiddleware().server(async ({ next }) => {
|
||||
try {
|
||||
@@ -26,6 +26,6 @@ const csrfMiddleware = createCsrfMiddleware({
|
||||
});
|
||||
|
||||
export const startInstance = createStart(() => ({
|
||||
functionMiddleware: [attachSupabaseAuth],
|
||||
functionMiddleware: [attachPocketBaseAuth],
|
||||
requestMiddleware: [errorMiddleware, csrfMiddleware],
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user