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:
2026-09-11 14:58:09 +02:00
co-authored by Claude Sonnet 5
parent 15885f32c7
commit 0f5a27ed5f
10 changed files with 160 additions and 87 deletions
+2 -2
View File
@@ -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],
}));