chore: revert standalone output and harden home page auth check

This commit is contained in:
2025-12-18 09:06:57 +01:00
parent 56178cea81
commit 1a0a132182
7 changed files with 14 additions and 10 deletions

View File

@@ -1 +1 @@
self.__RSC_SERVER_MANIFEST="{\n \"node\": {},\n \"edge\": {},\n \"encryptionKey\": \"l/OPnKIRnN1BmFcrFRSIU/W1xSwGbL96ruq9ikQxP4c=\"\n}"
self.__RSC_SERVER_MANIFEST="{\n \"node\": {},\n \"edge\": {},\n \"encryptionKey\": \"VrDE327/KbcRJ3uCy3S1rduGiQ+mf2ceOet4fh0iQnc=\"\n}"

View File

@@ -1,5 +1,5 @@
{
"node": {},
"edge": {},
"encryptionKey": "l/OPnKIRnN1BmFcrFRSIU/W1xSwGbL96ruq9ikQxP4c="
"encryptionKey": "VrDE327/KbcRJ3uCy3S1rduGiQ+mf2ceOet4fh0iQnc="
}

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,5 @@
/** @type {import('next').Config} */
const nextConfig = {
output: 'standalone',
productionBrowserSourceMaps: false,
transpilePackages: ['@supabase/auth-helpers-nextjs'],
webpack: (config, { isServer, dev }) => {

View File

@@ -15,11 +15,16 @@ export default function Home() {
useEffect(() => {
// Check session
const checkUser = async () => {
const { data: { session } } = await supabase.auth.getSession();
setUser(session?.user ?? null);
if (session?.user) {
fetchCollection();
} else {
try {
const { data: { session }, error } = await supabase.auth.getSession();
if (error) {
console.error('Session retrieval error:', error);
}
setUser(session?.user ?? null);
} catch (err) {
console.error('Fatal error checking user:', err);
setUser(null);
} finally {
setIsLoading(false);
}
};