mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 09:25:06 +03:00
fix: slack-clone example to use a single supabase client in order to prevent access-token out of sync
This commit is contained in:
1 parent
fed822f48c
commit
2befe81a1a
3 files changed
+3
-13
No files matched your search
@@ -1,7 +1,7 @@
|
||||
import { useState, useEffect } from 'react'
|
||||
import { createClient } from '@supabase/supabase-js'
|
||||
|
||||
const supabase = createClient(
|
||||
export const supabase = createClient(
|
||||
process.env.NEXT_PUBLIC_SUPABASE_URL,
|
||||
process.env.NEXT_PUBLIC_SUPABASE_KEY
|
||||
)
|
||||
|
||||
@@ -3,12 +3,7 @@ import React from 'react'
|
||||
import App from 'next/app'
|
||||
import Router from 'next/router'
|
||||
import UserContext from 'lib/UserContext'
|
||||
import { createClient } from '@supabase/supabase-js'
|
||||
|
||||
const supabase = createClient(
|
||||
process.env.NEXT_PUBLIC_SUPABASE_URL,
|
||||
process.env.NEXT_PUBLIC_SUPABASE_KEY
|
||||
)
|
||||
import { supabase } from 'lib/Store'
|
||||
|
||||
export default class SupabaseSlackClone extends App {
|
||||
state = {
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
import { useState, useContext } from 'react'
|
||||
import UserContext from 'lib/UserContext'
|
||||
import { createClient } from '@supabase/supabase-js'
|
||||
|
||||
const supabase = createClient(
|
||||
process.env.NEXT_PUBLIC_SUPABASE_URL,
|
||||
process.env.NEXT_PUBLIC_SUPABASE_KEY
|
||||
)
|
||||
import { supabase } from 'lib/Store'
|
||||
|
||||
const Home = () => {
|
||||
const { signIn } = useContext(UserContext)
|
||||
|
||||
Reference in new issue
Block a user