Β© 2026 Hedgehog Software, LLC
export const getServerSideProps = withPageAuth<Database>({ authRequired: false, async getServerSideProps(ctx, supabase) { try { const { id } = ctx.query const response = await supabase .from('Videos') .select(` title, description, likes, dislikes, views, created_at, VideoLikes ( type ), Profiles ( username, profile_picture_url ), Servers ( id, name ) `) .eq('id', id) .limit(1) .single() return { props: { video: response.data, userRating: response.data?.VideoLikes && response.data.VideoLikes[0] ? response.data.VideoLikes[0]['type'] : 0 } } } catch (error) { console.error(error) return { notFound: true } } }, })
next
@supabase/supabase-js
@supabase/auth-helpers-nextjs