From 5e1618869dc10f9678f1b2276634e47005ebe20b Mon Sep 17 00:00:00 2001 From: Parsa Asgari Date: Sun, 28 Apr 2024 15:59:16 +0100 Subject: [PATCH] another fix to iframe integration code --- app/sign-in/page.tsx | 2 +- components/login-form-searchparams.tsx | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/app/sign-in/page.tsx b/app/sign-in/page.tsx index 200025627..5b6deb2d8 100644 --- a/app/sign-in/page.tsx +++ b/app/sign-in/page.tsx @@ -39,7 +39,7 @@ export default async function SignInPage({ if (process.env.DEBUG_MODE) console.log("DEBUG MODE - IFRAME ===> TOKEN: ", token) const url = `${process.env.IFRAME_AUTH_API_BASE_URL}/${process.env.IFRAME_AUTH_API_PATH_URL}` const iframe_auth_response = await fetch(url, { - method: 'POST', + method: 'GET', headers: { Authorization: `Bearer ${token}` } }) const iframe_auth_response_json = await iframe_auth_response.json() diff --git a/components/login-form-searchparams.tsx b/components/login-form-searchparams.tsx index 5c99e9382..331d38376 100644 --- a/components/login-form-searchparams.tsx +++ b/components/login-form-searchparams.tsx @@ -1,7 +1,7 @@ 'use client' import * as React from 'react' -import { createClientComponentClient } from '@supabase/auth-helpers-nextjs' +import { createClient } from '@/utils/supabase/client' import { useRouter } from 'next/navigation' import { useEffect, useState } from 'react' @@ -16,11 +16,7 @@ export function LoginFormSearchParams({ }: LoginFormProps) { const [Session, setSession] = useState(0) const router = useRouter() - const supabase = createClientComponentClient({ - supabaseUrl:process.env.NEXT_PUBLIC_SUPABASE_URL, - supabaseKey:process.env.SUPABASE_SERVICE_ROLE_KEY, - cookieOptions: {domain: '', secure: 'true', maxAge: 604800, path: '', sameSite: 'None'} - }) + const supabase = createClient() // old: maxAge 900000 const BizGPTOrganization = process.env.BIZGPT_ORGANIZATION const email = `user_${user_id}@${BizGPTOrganization}.com`