bpeck81_
03/02/2023, 4:00 PMzetiks
03/02/2023, 4:53 PM.singInWithOauth()
does not seem to do anything, I believe it might be due to extension security policies.
So I assume I need to do this manually by calling .chrome.identity.launchWebAuthFlow()
which I am doing and it successfully returns the tokens. Now, the question is how do I use those OAuth tokens (access, refresh) with Supabase JS library to actually sign the user in? I did found that in the v1
of the library I could just do
const { user, session, error } = await db.auth.signIn({
refreshToken
});
But in the newest version of the library there is no db.auth.signIn()
. Even though here: https://supabase.com/docs/learn/auth-deep-dive/auth-deep-dive-jwts it is mentioned once. I couldn't find much more in the documentation and when Google just returns results from v1
.
How is it handled currently?JoshTheNerd
03/02/2023, 5:14 PMJoey9
03/02/2023, 5:33 PMRevaycolizer
03/02/2023, 7:24 PMconst getById = async (table, id) => {
const { data, error } = await supabase
.from(table)
.select("*")
.eq('id', id);
if (error) throw error;
return data[0];
}
nimo
03/02/2023, 7:33 PMid "uuid", match record
.
I'd like to order the result by one of the fields in the match column. Is it possible to do that? I am getting an error trying to run:
const { data: documents, error: rpcError } = await supabase
.rpc('...', { QUERY_PARAMS })
.select('*')
.order('match.similarity')
.limit(max_count);
desiboli
03/02/2023, 7:46 PMDATABASE_URL="postgresql://postgres:postgres@localhost:54322/postgres"
What could be the issue here?
Thanks for helping me 🙏pakkerr
03/02/2023, 8:09 PMKevin W
03/02/2023, 9:07 PMjs
db.from('themes')
.select('*, snippets (*), users (*)')
Error:
Could not embed because more than one relationship was found for 'themes' and 'users'
If I remove the users
join, it works fine. Obviously it's not sure whether to join user_id
from the original theme table, or perhaps the joined snippets table. Is there some way to specify which foreign key/table to join from?
Here's a simplified table structure (all appropriately foreign keyed):
themes:
id
user_id
users:
id
snippets:
id
user_id
themes_snippets (join table)
theme_id
snippet_idmlc
03/02/2023, 9:59 PM(requesting_user_id() = user_id)
Bizzare
03/02/2023, 10:05 PMChiggy
03/02/2023, 10:54 PMJoey9
03/03/2023, 12:16 AMtsx
type Profiles = Database['public']['Tables']['profiles']['Row'];
type UserProfile = Omit<Profiles, 'updated_at' | 'created_at'>;
MahdiWidian
03/03/2023, 2:08 AM49Ryann
03/03/2023, 3:05 AMlecookie
03/03/2023, 4:15 AMjs
// Follow this setup guide to integrate the Deno language server with your editor:
// https://deno.land/manual/getting_started/setup_your_environment
// This enables autocomplete, go to definition, etc.
import { serve } from "https://deno.land/std@0.168.0/http/server.ts";
import { createClient } from "https://esm.sh/@supabase/supabase-js@2";
import corsHeaders from "./_shared/cors.ts";
serve(async (req) => {
console.log(req)
try {
const supabase = createClient(
// Supabase API URL - env var exported by default.
Deno.env.get('SECRETSUPABASELINK') ?? '',
// Supabase API ANON KEY - env var exported by default.
Deno.env.get('SECRETSUPABASEKEY') ?? '',
// Create client with Auth context of the user that called the function.
// This way your row-level-security (RLS) policies are applied.
{ global: { headers: { Authorization: req.headers.get('Authorization')! } } }
)
} catch(e) => console.log(e)
const { option } = await req.json();
console.log(option)
let data = "no option provided";
if (option == "server") {
console.log('token')
const token =
Deno.env.get('BOTOKEN')
const headers = {
...corsHeaders,
Authorization: token,
"Content-Type": "application/json",
};
if ((await req.json().option) == "server") {
const res = await fetch(
"https://discord.com/api/guilds/1068721953185206354/preview",
{
headers: headers,
}
);
data = await res.json();
}
return new Response(JSON.stringify(data), {
headers: headers,
});
} else if (option === "kick") {
console.log('kick')
const {data,error} = await supabase.from('publicprofile').select()
console.log(data)
}
});
DanMossa
03/03/2023, 6:56 AMlake_mattiato
03/03/2023, 8:14 AMostoto
03/03/2023, 8:22 AMskopd
03/03/2023, 9:21 AMlake_mattiato
03/03/2023, 9:37 AMelliott
03/03/2023, 9:45 AMlake_mattiato
03/03/2023, 10:28 AMShaneJones
03/03/2023, 11:10 AMconst clearPendingRecords = await supabase
.from('bookings')
.update({'booking_status': 4})
.update({'hold_until': null})
.eq('booking_status', 2)
.lt('hold_until', Date.now())
Is the ordering incorrect here or am I miles off on this?bekathegooner
03/03/2023, 11:25 AMdonbwhite
03/03/2023, 1:38 PMerror: "invalid_grant"
error_description: "Invalid login credentials"
But if I send the same request, apikey, via PostMan it works as expected and returns the user. Has anyone encountered anything like that before? The email is validated an verified in both the supabase ui and confirmed that it works in PostMan.Vimes
03/03/2023, 2:28 PMFilippoBrigati
03/03/2023, 3:25 PMAmara
03/03/2023, 4:52 PMoldwired
03/03/2023, 5:10 PM