This commit is contained in:
parent
912d6c012f
commit
17c59dbb91
|
|
@ -16,8 +16,7 @@ import { getAssistantImageFromStorage } from "@/db/storage/assistant-images"
|
|||
import { getToolWorkspacesByWorkspaceId } from "@/db/tools"
|
||||
import { getWorkspaceById } from "@/db/workspaces"
|
||||
import { convertBlobToBase64 } from "@/lib/blob-to-b64"
|
||||
//import { supabase } from "@/lib/supabase/browser-client"
|
||||
import { createClient } from "@/lib/supabase/browser-client"
|
||||
import { supabase } from "@/lib/supabase/browser-client"
|
||||
import { LLMID } from "@/types"
|
||||
import { useParams, useRouter, useSearchParams } from "next/navigation"
|
||||
import { ReactNode, useContext, useEffect, useState } from "react"
|
||||
|
|
@ -75,7 +74,6 @@ export default function WorkspaceLayout({ children }: WorkspaceLayoutProps) {
|
|||
|
||||
useEffect(() => {
|
||||
;(async () => {
|
||||
const supabase = await createClient()
|
||||
const session = (await supabase.auth.getSession()).data.session
|
||||
|
||||
if (!session) {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
"use client"
|
||||
|
||||
import { ChangePassword } from "@/components/utility/change-password"
|
||||
//import { supabase } from "@/lib/supabase/browser-client"
|
||||
import { createClient } from "@/lib/supabase/browser-client"
|
||||
import { supabase } from "@/lib/supabase/browser-client"
|
||||
import { useRouter } from "next/navigation"
|
||||
import { useEffect, useState } from "react"
|
||||
|
||||
|
|
@ -18,7 +17,6 @@ export default function ChangePasswordPage() {
|
|||
|
||||
useEffect(() => {
|
||||
;(async () => {
|
||||
const supabase = await createClient()
|
||||
const session = (await supabase.auth.getSession()).data.session
|
||||
|
||||
if (!session) {
|
||||
|
|
|
|||
|
|
@ -10,8 +10,7 @@ import {
|
|||
fetchHostedModels,
|
||||
fetchOpenRouterModels
|
||||
} from "@/lib/models/fetch-models"
|
||||
//import { supabase } from "@/lib/supabase/browser-client"
|
||||
import { createClient } from "@/lib/supabase/browser-client"
|
||||
import { supabase } from "@/lib/supabase/browser-client"
|
||||
import { TablesUpdate } from "@/supabase/types"
|
||||
import { useRouter } from "next/navigation"
|
||||
import { useContext, useEffect, useState } from "react"
|
||||
|
|
@ -97,7 +96,6 @@ export default function SetupPage() {
|
|||
|
||||
useEffect(() => {
|
||||
;(async () => {
|
||||
const supabase = await createClient()
|
||||
const session = (await supabase.auth.getSession()).data.session
|
||||
|
||||
if (!session) {
|
||||
|
|
@ -153,7 +151,6 @@ export default function SetupPage() {
|
|||
}
|
||||
|
||||
const handleSaveSetupSetting = async () => {
|
||||
const supabase = await createClient()
|
||||
const session = (await supabase.auth.getSession()).data.session
|
||||
if (!session) {
|
||||
// return router.push(`/${locale}/login`)
|
||||
|
|
|
|||
|
|
@ -25,6 +25,12 @@ export async function createClient() {
|
|||
return _supabase
|
||||
}
|
||||
|
||||
// Export the supabase client directly for easier usage
|
||||
export const supabase = async () => {
|
||||
// Simply return the client created by createClient
|
||||
return await createClient()
|
||||
}
|
||||
|
||||
async function getRuntimeSupabaseUrl(retry = 30, interval = 50): Promise<string> {
|
||||
for (let i = 0; i < retry; i++) {
|
||||
const url = window?.RUNTIME_ENV?.SUPABASE_URL
|
||||
|
|
|
|||
Loading…
Reference in New Issue