chore: revert standalone output and harden home page auth check
This commit is contained in:
BIN
.next/cache/webpack/client-development/index.pack.gz
vendored
BIN
.next/cache/webpack/client-development/index.pack.gz
vendored
Binary file not shown.
Binary file not shown.
@@ -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}"
|
||||
@@ -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
@@ -1,6 +1,5 @@
|
||||
/** @type {import('next').Config} */
|
||||
const nextConfig = {
|
||||
output: 'standalone',
|
||||
productionBrowserSourceMaps: false,
|
||||
transpilePackages: ['@supabase/auth-helpers-nextjs'],
|
||||
webpack: (config, { isServer, dev }) => {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user