Self
01/20/2023, 10:20 AMjs
async function signInWithDiscord() {
const { data, error } = await supabase.auth.signInWithOAuth({
provider: 'discord',
})
}
hotshoe
01/20/2023, 10:22 AMJoel
01/20/2023, 10:27 AM_shared
folder mentioned here https://supabase.com/docs/guides/functions/quickstart#organizing-your-edge-functions.
Then I tried reading the file based on the following documentation: https://deno.land/manual@v1.29.1/examples/read_write_filesATorres
01/20/2023, 10:51 AMonesc
01/20/2023, 11:34 AMtypescript
const { data, error } = await supabase
.from("entries")
.insert([{ some_column: "someValue" }, { some_column: "otherValue" }]);
I just want types for data and error.flapili (FR, bad EN)
01/20/2023, 1:08 PMDbugger
01/20/2023, 1:27 PMjs
const App = ({ Component, pageProps }) => {
console.log('Rendering App');
const [supabaseClient] = useState(() => createBrowserSupabaseClient());
return (
<SessionContextProvider
supabaseClient={supabaseClient}
initialSession={pageProps.initialSession}
>
<>Foo</>
</SessionContextProvider>
);
};
And I have noticed that from a normal Chrome window, App renders only once, but from an INCOGNITO Chrome window, it renders twice!
How could this be possible?Yechi
01/20/2023, 1:48 PMKjell
01/20/2023, 2:08 PM13:59:02.651 [error] Could not create schema migrations table. This error usually happens due to the following:
* The database does not exist
* The "schema_migrations" table, which Ecto uses for managing
migrations, was defined by another library
* There is a deadlock while migrating (such as using concurrent
indexes with a migration_lock)
I read on the internet that it could be fixed by manually creating the realtime schema; but I already have the schema. I even tried to delete the table "schema_migrations", after which the issue persisted. Hope you can help me out!
New realtime container:
realtime:
container_name: supabase-realtime
image: supabase/realtime:v2.1.0
depends_on:
- db # Disable this if you are using an external Postgres database
restart: unless-stopped
environment:
PORT: 4000
DB_HOST: ${POSTGRES_HOST}
DB_PORT: ${POSTGRES_PORT}
DB_USER: ${POSTGRES_USER}
DB_PASSWORD: ${POSTGRES_PASSWORD}
DB_NAME: ${POSTGRES_DB}
DB_AFTER_CONNECT_QUERY: 'SET search_path TO _realtime'
DB_ENC_KEY: supabaserealtime
API_JWT_SECRET: ${JWT_SECRET}
FLY_ALLOC_ID: fly123
FLY_APP_NAME: realtime
SECRET_KEY_BASE: UpNVntn3cDxHJpq99YMc1T1AQgQpc8kfYTuRgBiYa15BLrx8etQoXz3gZv1/u2oq
ERL_AFLAGS: -proto_dist inet_tcp
ENABLE_TAILSCALE: "false"
DNS_NODES: "''"
command: >
sh -c "/app/bin/migrate && /app/bin/realtime eval 'Realtime.Release.seeds(Realtime.Repo)' && /app/bin/server"
Old container:
-> see this merge https://github.com/supabase/supabase/commit/9b163309c83a7344c46e78615dba196f7880038bKaran
01/20/2023, 2:47 PMn10000k
01/20/2023, 2:59 PMemin
01/20/2023, 3:31 PMhttps://{MY URL}.supabase.co/storage/buckets/{BUCKET_NAME}/files/
I modified the Policies so bucket is public and anyone can upload/delete etc...
Another response I get with some variants of the URL:
The parent resource is not found
Any advice is more than welcome, kind of feel like I am stumbling in the dark, sending a simple JSON to who knows where 😂spatialy
01/20/2023, 3:35 PMKjell
01/20/2023, 4:15 PMlarryM
01/20/2023, 4:32 PMVik
01/20/2023, 4:50 PMBeastSnake
01/20/2023, 6:27 PMsupabaseClient.auth.signInWithOAuth({
provider: 'discord',
options: {
scopes: 'identify guilds'
}
})
**After authenticating **the provider_token and **provider_refresh_token **in the **Session **are set properly and I can do valid Requests to Discord API
After some minutes that values are getting null.
I hope you guys can help me with my problem.
Greetings!imagio
01/20/2023, 6:41 PMdrewbie
01/20/2023, 7:11 PMCREATE FUNCTION public.create_offer (offer_products jsonb, offer_message text)
RETURNS VOID
LANGUAGE plpgsql
AS $$
DECLARE
offer record;
offer_product record;
BEGIN
INSERT INTO offer (message, account_id)
VALUES (offer_message, auth.uid ());
FOR offer_product IN (
SELECT
(offer_product ->> 'product_id')::uuid AS product_id,
(offer_product ->> 'price')::numeric AS price
FROM
JSONB_ARRAY_ELEMENTS(offer_data))
LOOP
INSERT INTO offer_products (offer_id, product_id, price)
VALUES (offer.id, product_id, price);
END LOOP;
END;
$$;
and the rpc call to this function generated by Supabase has the args typed as such
.rpc<"create_offer", {
Args: {
offer_products: Json;
offer_message: string;
};
Im fine creating some sort of layer that sets the expected type for offer_products
, but wanted to check here if the rpc function type generation can pick up on anything to type out the Json structure, vs just typing it as Json.
Any help is appreciated!Irfan Ahmed
01/20/2023, 7:45 PMRake
01/20/2023, 8:06 PMmlc
01/20/2023, 8:56 PMrefreshCallbackFunction({ access_token, refresh_token }) {
const supabase = createClient(process.env.NEXT_PUBLIC_SUPABASE_URL, process.env.SUPABASE_SECRET_KEY); // Gets around RLS
const oldToken = this.auth_token;
const newToken = { access_token, refresh_token }
return new Promise((resolve, reject) => {
console.log("old token: ", oldToken); // Prints properly
console.log("new token: ", { access_token, refresh_token }); // Prints properly
supabase
.from("user_connections")
.update({
auth_token: {
access_token: access_token,
refresh_token: refresh_token,
}
})
.eq("auth_token", JSON.stringify(oldToken))
.select()
.then((response) => {
console.log('response', response);
resolve();
})
.catch((error) => {
reject(error);
});
});
}
fast
01/20/2023, 10:17 PMkonga
01/20/2023, 10:37 PM(storage.foldername(name))[1]
but that table contains a name column then it doesn't work.
The picture is default example1voy
01/20/2023, 10:42 PMexport default function Home({
lessons,
user,
}: InferGetStaticPropsType<typeof getStaticProps>) {
console.log(user);
return (
<div className='w-full max-w-3xl mx-auto my-16 px-2'>
{lessons.map((lesson: InferGetStaticPropsType<typeof getStaticProps>) => (
<Link legacyBehavior key={lesson.id} href={lesson.id.toString()}>
<a className='p-8 h-40 mb-4 rounded shadow text-xl flex'>
{lesson.title}
</a>
</Link>
))}
</div>
);
}
export const getStaticProps: GetStaticProps = async () => {
const { data: lessons }: PostgrestResponse<any> = await supabase
.from('lesson')
.select('*');
const {
data: { user },
} = await supabase.auth.getUser();
return {
props: {
lessons,
user,
},
};
};
logemann
01/20/2023, 11:11 PMindex.js?46cb:602 Uncaught TypeError: Cannot read properties of undefined (reading 'cookies')
at cookies (webpack-internal:///(sc_server)/./node_modules/next/dist/client/components/headers.js:27:25)
at getCookie (webpack-internal:///(sc_server)/./node_modules/@supabase/auth-helpers-nextjs/dist/index.js:355:33)
at createServerSupabaseClient (webpack-internal:///(sc_server)/./node_modules/@supabase/auth-helpers-shared/dist/index.js:355:52)
at createServerComponentSupabaseClient (webpack-internal:///(sc_server)/./node_modules/@supabase/auth-helpers-nextjs/dist/index.js:346:71)
at createServerClient (webpack-internal:///(sc_server)/./utils/supabase-server.ts:14:130)
at eval (webpack-internal:///(sc_server)/./app/(member)/properties/onboarding/page.tsx:16:92)
at (sc_server)/./app/(member)/properties/onboarding/page.tsx (file:///Users/ml/development/projects/nextjs/coming-home-nextjs/.next/server/app/(member)/properties/page.js:1669:1)
at __webpack_require__ (/Users/ml/development/projects/nextjs/coming-home-nextjs/.next/server/webpack-runtime.js:33:43)
at eval (webpack-internal:///(sc_server)/./app/(member)/properties/page.tsx:8:74)
at (sc_server)/./app/(member)/properties/page.tsx (file:///Users/ml/development/projects/nextjs/coming-home-nextjs/.next/server/app/(member)/properties/page.js:1680:1)
Is there anything you can think of, why there is no cookie in the request? Or even better, where a whole cookie object is not defined? My main layout is also a server component and there i dont have this error. Of course i am using:
createServerComponentSupabaseClient() from auth-helpers package.
Thanks for any hint.micma
01/20/2023, 11:19 PMven
01/20/2023, 11:24 PMFi
01/21/2023, 12:04 AMJoshLopez
01/21/2023, 12:08 AM