Guille
02/28/2023, 11:34 AMHeyl
02/28/2023, 11:37 AMjson
{
"message": "An invalid response was received from the upstream server"
}
EDIT: I did manual restart of project but did not fix them problemjfbn
02/28/2023, 12:01 PMDenNis
02/28/2023, 12:28 PMVimes
02/28/2023, 12:28 PMjs
type Audit = {
content: {
descendants: { items: ContentProps[] };
id: string;
level: number;
name: string;
};
};
type Organization = {
org: {
organization: {
slug: string | null | undefined;
};
};
};
const audit = (await getAudit(
(`/granskninger/${org?.organization?.slug as Organization}`) + <- ERROR IS HERE
`/${ctx.query.slug as string}`
)) as Audit;
Katoka
02/28/2023, 1:26 PMLUCIFER
02/28/2023, 1:49 PMFluffySmiles
02/28/2023, 3:28 PMShraow
02/28/2023, 3:37 PMDikiyKazah
02/28/2023, 3:52 PMBamsespartymix
02/28/2023, 4:30 PMimport React, { useEffect, useState } from "react";
import { supabase } from "../../utils/supabaseClient";
function ResetPassword() {
const [password, setPassword] = useState("");
const [token, setToken] = useState();
useEffect(() => {
const params = new URLSearchParams(window.location.search);
setToken(params.get("token"));
}, []);
const handleSubmit = async (e) => {
e.preventDefault();
if (token) {
const { error } = await supabase.auth.updateUser(token, {
password: password,
});
if (error) {
console.log("Something went wrong");
console.log(error);
} else if (!error) {
console.log("password has changed");
}
}
};
return (
<div>
<form onSubmit={(e) => handleSubmit(e)}>
<input
type="password"
required
value={password}
placeholder="Please enter your Password"
onChange={(e) => setPassword(e.target.value)}
/>
<button type="submit">Submit</button>
</form>
</div>
);
}
export default ResetPassword;
I get this error "AuthSessionMissingError: Auth session missing!".
Hope someone can help me! 🙂Gentlemonke
02/28/2023, 4:32 PMTradeUpCards
02/28/2023, 4:59 PMzetiks
02/28/2023, 5:08 PMUUID
or text
. Then, based on that I would like to use the or()
method in JavaScript to select the row if it matches either UUID or the `username`:
js
.or(`username.eq.${params.username},id.eq.${params.username}`)
The above works if I pass the UUID as params.username
, but fails when I pass a text, because it expects the id
column to be UUID. Is there a way to tell supabase to just keep it calm and try get me the results even if the second argument in or
statement is wrong type?
I could, in theory, check if the param matches the UUID format with regexp, but am wondering if there might be a simpler way?jumeh
02/28/2023, 5:47 PMtheravenstone
02/28/2023, 6:38 PMŘambo
02/28/2023, 7:52 PMfull_name
in public.profiles
table under username
In the public.profiles
table username
column is set to unique. What happens if two users login with social provider and have the same name. Will the trigger throw an error or something?squallsama
02/28/2023, 8:44 PMfidelio
02/28/2023, 8:49 PMsupabase_migrations
schema be a public / unprotected schema?maglev
02/28/2023, 9:16 PMRevaycolizer
02/28/2023, 9:38 PMrafael
02/28/2023, 10:33 PMimagio
02/28/2023, 10:38 PMts
connection.from("myTable").select("*").eq("members->NTfzpLMrWFZPYjSGCaGdwCIh5Ti2->userId", "NTfzpLMrWFZPYjSGCaGdwCIh5Ti2")
However this fails with {"code": "22P02", "details": "Token \"NTfzpLMrWFZPYjSGCaGdwCIh5Ti2\" is invalid.", "hint": null, "message": "invalid input syntax for type json"
(trying to put quotes around it doesn't change the outcome either)
I can execute this query in any sql editor in a number of ways, such as
sql
select * from public."myTable" t
-- where t.members -> 'NTfzpLMrWFZPYjSGCaGdwCIh5Ti2' ->> 'userId' = 'NTfzpLMrWFZPYjSGCaGdwCIh5Ti2'
-- where t.members @> '{"NTfzpLMrWFZPYjSGCaGdwCIh5Ti2": {"userId": "NTfzpLMrWFZPYjSGCaGdwCIh5Ti2"}}'
where t.members @? '$.NTfzpLMrWFZPYjSGCaGdwCIh5Ti2.userId'
Any of those three techniques works with plain SQL. None of them seem possible with the JS SDK. How can I query nested fields with arbitrary string keys from the JS SDK?fidelio
02/28/2023, 11:38 PMcreateServerClient
function for server components in Next.js 13.
Here's the server component code I'm using
import "server-only";
import { createServerClient } from "@/lib/supabase-server";
// do not cache this page
export const revalidate = 0;
export default async function Page() {
const supabase = createServerClient();
const { data, error, status } = await supabase
.from("profiles")
.select("*")
.single();
if (error) {
console.error(error);
console.error(status);
}
return (
<p>Welcome, {data?.id}!</p>
);
}
I get the following error:
{
message: 'FetchError: fetch failed',
details: '',
hint: '',
code: ''
}
0
The strange thing is that I'm able to properly query the database from client components ("use client")
"use client";
import { useRouter } from "next/navigation";
import { useSupabase } from "@/components/supabase-provider";
import { Auth } from "@supabase/auth-ui-react";
import { ThemeSupa } from "@supabase/auth-ui-shared";
import { useEffect, useState } from "react";
export default function Login() {
const { supabase, session } = useSupabase();
const [userId, setUserId] = useState<string | null>();
const router = useRouter();
useEffect(() => {
if (session) {
router.push("/");
}
}, [session, router]);
return session ? (
<>
<h1>Logged in as {userId}</h1>
</>
) : (
<>
<h1 className="mb-5 font-title text-2xl">Sign In</h1>
<Auth supabaseClient={supabase} appearance={{ theme: ThemeSupa }} />
</>
);
}
In this case, I'm able to see the Logged in as {userId}
show with the correct id from the profiles table.
Any help would be appreciated. Thanks!
https://supabase.com/docs/guides/auth/auth-helpers/nextjs-server-componentsAergis
02/28/2023, 11:45 PMVersion 1.30.3 is already installed
Bundling results
Error: Error bundling function: signal: abort trap
file:///src/import_map.json
file:///src/index.ts
assertion failed [block != nullptr]: BasicBlock requested for unrecognized address
(BuilderBase.h:550 block_for_offset)
I've narrowed it down to adding the createClient import for supabase from deno. If I remove that import (and the subsequent supabse.from call) it will deploy correctly.
Here is the function code
import { serve } from "https://deno.land/std@0.177.0/http/server.ts";
import { createClient } from "https://esm.sh/@supabase/supabase-js@2";
serve(async (req) => {
console.log(Deno.env.get("SUPABASE_URL"));
const supabase = createClient(Deno.env.get("SUPABASE_URL") as string, Deno.env.get("SUPABASE_ANON_KEY") as string);
await supabase.from("posts").update({ complete: true }).eq("custom_id", "1611b321-baa4-46cc-9305-c9b70757633a");
return new Response(JSON.stringify({}), { headers: { "Content-Type": "application/json" } });
});
supersonicart
03/01/2023, 12:14 AMprenx4x
03/01/2023, 12:24 AMelliott
03/01/2023, 12:36 AMnimo
03/01/2023, 12:47 AM