-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed restaurant index page and add config file instaed of env
- Loading branch information
1 parent
80d7023
commit 4bbcc6a
Showing
7 changed files
with
39 additions
and
294 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export default Object.freeze({ | ||
SUPABASE_URL: SUPABASE_URL, | ||
SUPABASE_ANON_KEY: SUPABASE_ANON_KEY, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
import { createClient } from "@supabase/supabase-js"; | ||
import config from "@/config"; | ||
|
||
export default createClient( | ||
process.env.NEXT_PUBLIC_SUPABASE_URL!, | ||
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY! | ||
); | ||
export default createClient(config.SUPABASE_URL, config.SUPABASE_ANON_KEY); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
import { createBrowserClient } from "@supabase/ssr"; | ||
import config from "@/config"; | ||
|
||
export const createClient = () => | ||
createBrowserClient( | ||
process.env.NEXT_PUBLIC_SUPABASE_URL!, | ||
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!, | ||
); | ||
createBrowserClient(config.SUPABASE_URL, config.SUPABASE_ANON_KEY); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,31 @@ | ||
import { createServerClient, type CookieOptions } from "@supabase/ssr"; | ||
import { cookies } from "next/headers"; | ||
import config from "@/config"; | ||
|
||
export const createClient = (cookieStore: ReturnType<typeof cookies>) => { | ||
return createServerClient( | ||
process.env.NEXT_PUBLIC_SUPABASE_URL!, | ||
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!, | ||
{ | ||
cookies: { | ||
get(name: string) { | ||
return cookieStore.get(name)?.value; | ||
}, | ||
set(name: string, value: string, options: CookieOptions) { | ||
try { | ||
cookieStore.set({ name, value, ...options }); | ||
} catch (error) { | ||
// The `set` method was called from a Server Component. | ||
// This can be ignored if you have middleware refreshing | ||
// user sessions. | ||
} | ||
}, | ||
remove(name: string, options: CookieOptions) { | ||
try { | ||
cookieStore.set({ name, value: "", ...options }); | ||
} catch (error) { | ||
// The `delete` method was called from a Server Component. | ||
// This can be ignored if you have middleware refreshing | ||
// user sessions. | ||
} | ||
}, | ||
return createServerClient(config.SUPABASE_URL, config.SUPABASE_ANON_KEY, { | ||
cookies: { | ||
get(name: string) { | ||
return cookieStore.get(name)?.value; | ||
}, | ||
set(name: string, value: string, options: CookieOptions) { | ||
try { | ||
cookieStore.set({ name, value, ...options }); | ||
} catch (error) { | ||
// The `set` method was called from a Server Component. | ||
// This can be ignored if you have middleware refreshing | ||
// user sessions. | ||
} | ||
}, | ||
remove(name: string, options: CookieOptions) { | ||
try { | ||
cookieStore.set({ name, value: "", ...options }); | ||
} catch (error) { | ||
// The `delete` method was called from a Server Component. | ||
// This can be ignored if you have middleware refreshing | ||
// user sessions. | ||
} | ||
}, | ||
}, | ||
); | ||
}); | ||
}; |