AntDX316
01/17/2023, 8:35 AMmiky2fois
01/17/2023, 9:12 AMfridon
01/17/2023, 9:23 AMleonardi
01/17/2023, 10:04 AMekko
01/17/2023, 11:33 AMAbdul ♥
01/17/2023, 12:04 PM{
"code": 400,
"msg": "OAuth state parameter missing"
}
Mofoga
01/17/2023, 2:57 PMJohnny
01/17/2023, 3:10 PMts
status: {
code: '42501',
details: null,
hint: null,
message: 'new row violates row-level security policy for table "profiles"'
}
with the code:
ts
const body = Object.fromEntries(await request.formData())
/**
* Passwords must match
*/
if(body.password !== body.confirmPassword) {
return fail(400, {
error: "Passwords do not match",
})
}
/**
* Password must be at least 8 characters and max 32 characters
*
*/
if(body.password.length < 8 || body.password.length > 32) {
return fail(400, {
error: "Password must be at least 8 characters and max 32 characters",
})
}
/**
* First name and Last name check
*/
if(body.firstName === "" || body.lastName === "") {
return fail(400, {
error: "First and last name are required",
})
}
const { data, error: err } = await locals.sb.auth.signUp({
email: body.email as string,
password: body.password as string,
})
if(data?.user == null){
return fail(400, {
error: "User creation failed",
})
}
await createProfile(data?.user,body);
async function createProfile(data: User, body: any){
console.log(data.id)
let f = "Bob"
let l = "Smith"
const { error, status } = await locals.sb
.from('profiles').insert([{ id: data.id, full_name: (f + " " + l)}])
console.log("status: ", error)
}
But the row is being created (no full_name is being set -> null) anyone an idea why?corey
01/17/2023, 5:34 PMryanT
01/17/2023, 6:38 PMgetIntrospectionQuery({description: false})
it is not respected and description is still requested.
Any thoughts on how to get past this?BoogersLLC
01/17/2023, 7:14 PMmonks1975
01/17/2023, 8:49 PMSinistral
01/17/2023, 9:52 PMDYELbrah
01/17/2023, 11:01 PMjinsley8
01/17/2023, 11:31 PMjinsley8
01/17/2023, 11:46 PMsql
SELECT brand
FROM products
WHERE brand = "ABC"
usamichizuru
01/18/2023, 1:39 AMElliott Storey
01/18/2023, 1:57 AMbob_the_robot
01/18/2023, 2:40 AMjs
return supabase
.from("games")
.select("*")
.eq("is_active", true)
.contains("players", [user.id])
.then(...)
Not sure how to replicate the contains
portion in the below query, any guidance is great!
js
return supabase
.channel("game-channel")
.on(
"postgres_changes",
{
event: "*",
schema: "public",
table: "games",
filter: `is_active=eq.true`,
},
(payload) => {
console.log("Change received!", payload);
}
)
.subscribe();
I read through https://supabase.com/docs/reference/javascript/subscribe but there doesn't seem to be any examples of multiple filters being used. T.Hanks!Vik
01/18/2023, 2:41 AMuser_one
or user_two
are equal to the logged in user.
But, right now when I request this data my own profile is also returned multiple times. How can I add a filter to this where I only get all other profiles but my own for each friendship?
export const getFriendships = async () => {
const { data, error } = await supabaseClient
.from('friendships')
.select('*, user_one(*), user_two(*)');
if (error) {
throw Error(error.message);
}
return data;
};
darick
01/18/2023, 7:02 AMRickRyan26
01/18/2023, 7:31 AM{
"message": "No API key found in request",
"hint": "No `apikey` request header or url param was found."
}
STILLWATER;
01/18/2023, 8:21 AMWHERE name LIKE $1
or age=$1
etc, is this code sql injectable??rbsam
01/18/2023, 9:44 AMMaGnezij
01/18/2023, 9:46 AMSerj Hunt
01/18/2023, 10:34 AMAntDX316
01/18/2023, 11:25 AMFainaru
01/18/2023, 11:52 AMHugoDuprez
01/18/2023, 12:46 PMbob_the_robot
01/18/2023, 2:51 PMuuid[]
that correspond to each player's "profile". Any "player" in a "game" can UPDATE the row with the latest game state. I have RLS setup as
sql
(uid() = ANY (players))
for both of the required boolean expressions, but whenever a user tries to update the row I get Error: new row violates row-level security policy for table "games"
Maybe there is a better way to do this?