bennettcolecohen
04/24/2023, 8:34 PMconst { data, error } = await supabase.auth.signInWithOAuth({
provider: 'azure',
options: {
scopes: 'email',
redirectTo: 'http://localhost:5173/welcome'
}
});
kpradel
04/24/2023, 8:53 PMhttps://cdn.discordapp.com/attachments/1100162648869449770/1100162649381142578/image.png▾
https://cdn.discordapp.com/attachments/1100162648869449770/1100162649599254588/image.png▾
PTS
04/24/2023, 9:34 PMApollo
04/24/2023, 10:18 PMelliott
04/24/2023, 10:22 PM매튜
04/24/2023, 10:54 PMHE4TED
04/24/2023, 11:23 PMeth
04/25/2023, 12:09 AMjose
dependency to verify it.
https://github.com/supabase/self-hosted-edge-functions-demo/blob/main/functions/main/index.ts#L24
However, I don't see:
import * as jose from 'https://deno.land/x/jose@v4.14.1/index.ts'
As a dependency. Is that missing in this example?wiverson
04/25/2023, 12:44 AMshane0
04/25/2023, 3:26 AMJ1PHILLI
04/25/2023, 4:20 AMerror: TS2322 [ERROR]: Type 'import("https://esm.sh/v117/@supabase/supabase-js@2.15.0/dist/module/SupabaseClient.d.ts").default<any, "public", any>' is not assignable to type 'import("https://esm.sh/v117/@supabase/supabase-js@2.21.0/dist/module/SupabaseClient.d.ts").default<any, "public", any>'.
Property 'supabaseUrl' is protected but type 'SupabaseClient<Database, SchemaName, Schema>' is not a class derived from 'SupabaseClient<Database, SchemaName, Schema>'.
client,
~~~~~~
at file:///home/deno/functions/aifetcher/index.ts:34:5
The expected type comes from property 'client' which is declared here on type 'SupabaseLibArgs'
client: SupabaseClient;
~~~~~~
at https://esm.sh/v117/langchain@0.0.52/dist/retrievers/supabase.d.ts:7:5
https://cdn.discordapp.com/attachments/1100275023190708254/1100275023375245382/CleanShot_2023-04-24_at_22.11.05.png▾
WALTERB
04/25/2023, 5:05 AM<div class="navbar">
<button id="signed" onclick="signin()">Sign in with discord</button>
<button id="out" class="right" onclick="signout()">Sign out with discord</button>
</div>
<p id="name">Not logged in!</p>
MY JS:
const _supabase = supabase.createClient(supabaseUrl, supabaseKey)
async function signin() {
const {data, error} = await _supabase.auth.signInWithOAuth({
provider: 'discord',
})
checking()
}
async function getName() {
const {data: {user}} = await _supabase.auth.getUser()
const fullName = user.user_metadata.full_name
document.getElementById('name').textContent = `${fullName} `
checking()
}
getName()
async function signout() {
const {error} = await _supabase.auth.signOut()
document.getElementById('name').textContent = "Not logged in!"
alert("Signed out!")
checking()
}
guidsen
04/25/2023, 6:33 AMfabio
04/25/2023, 8:27 AMj3llybeans
04/25/2023, 8:40 AMconst [supabaseClient] = useState(() => createBrowserSupabaseClient())
(from _app.tsx
), and i found a method called supabaseClient.auth.startAutoRefresh()
.
Do i only need to call this inside _app.tsx
and then it does its magic? Or do i need to do further digging inside the session object?sigh839493
04/25/2023, 9:40 AMhttps://cdn.discordapp.com/attachments/1100355684991762453/1100355685427982376/supabase_otp_error.png▾
KBar
04/25/2023, 9:48 AMbkyerv
04/25/2023, 11:26 AMNovus
04/25/2023, 1:15 PMjs
import {serve} from "https://deno.land/std@0.168.0/http/server.ts"
import { Application, Router, type Context } from 'https://deno.land/x/oak/mod.ts';
serve(async (_req: unknown) => {
try {
const router = new Router()
router
// Note: path should be prefixed with function name
.get('/oak-server', (context: Context) => {
context.response.body = 'This is an example Oak server running on Edge Functions!'
})
.get('/oak-server/redirect', (context: Context) => {
context.response.redirect('https://www.example.com')
})
const app = new Application()
app.use(router.routes())
app.use(router.allowedMethods())
await app.listen({port: 8000})
return new Response(String(), {status: 200})
} catch (err) {
//console.error(err)
return new Response(String(err?.message ?? err), {status: 500})
}
}).then(r => console.log(r))
If I sent the get request I receive in all requests
> can only listen once
Can someone help me?PatrickJ
04/25/2023, 1:47 PMcreate or replace function update_points(new_points point[])
returns void
language plpgsql
security definer set search_path = public
as $$
begin
-- Start transaction
begin;
-- Delete current points
delete from points;
-- Insert new points
insert into points (name, location)
-- Loop over the array of new points using generate_series
select new_points[i].name,
-- Use ST_MakePoint to create a point geometry from the longitude and latitude values
-- Use ST_SetSRID to set the correct SRID (4326) for the geography type
st_setsrid(st_makepoint(new_points[i].lon, new_points[i].lat), 4326)
from generate_series(array_lower(new_points, 1), array_upper(new_points, 1)) as i
-- Filter out any records where the name, longitude, or latitude is NULL
where new_points[i].name is not null
and new_points[i].lon is not null
and new_points[i].lat is not null;
-- Rebuild the spatial index
reindex index points_geo_index;
-- Commit transaction
commit;
end;
$$;
chirptune
04/25/2023, 2:44 PMpsql
, but when I add this script to supabase/seed.sql and I reset the db, it fails saying:
Error: ERROR: schema "pgtle" does not exist (SQLSTATE 3F000)
Sometimes I run some tests without begin
and rollback
to see what the data looks like when they fail, and resetting deletes all that data and installed extensions, so I like resetting for that reason.Dan Rumney
04/25/2023, 2:55 PMWITH response_times AS (
select
request.path,
response.origin_time AS time
FROM
edge_logs t
cross join unnest(metadata) as m
cross join unnest(m.response) as response
cross join unnest(m.request) as request
ORDER BY
request.path ASC, response.origin_time ASC)
SELECT path, time from response_times;
Responds with can't find source response_times
Is there a way to do advanced querying?ven
04/25/2023, 3:03 PM-- -- create bucket saas;
insert into storage.buckets (id, name) values ('saas', 'saas');
-- create policies for the newly created buckets
-- Allow public access to any files in the "saas" bucket
create policy "Public Access"
on storage.objects for select
using ( bucket_id = 'saas' );
-- Allow select access to any files in the "saas" bucket
CREATE POLICY "Give users select access to own folder" ON storage.objects FOR SELECT TO public USING (bucket_id = 'saas' AND auth.uid()::text = (storage.foldername(name))[1]);
-- Allow insert access to any files in the "saas" bucket
CREATE POLICY "Give users insert access to own folder" ON storage.objects FOR INSERT TO public WITH CHECK (bucket_id = 'saas' AND auth.uid()::text = (storage.foldername(name))[1]);
How do i prepend this script with an "if exists drop/delete bucket 'saas'"? thank youchris ho
04/25/2023, 3:13 PMchris ho
04/25/2023, 3:23 PMhttps://cdn.discordapp.com/attachments/1100441984960839831/1100441985283797123/image.png▾
CamBlackwood
04/25/2023, 3:59 PMno1home
04/25/2023, 4:48 PMSonny Vesali
04/25/2023, 5:24 PMcom.supabase_auth_sandbox.app
I've also set the sub-domain for it like this com.supabase_auth_sandbox.app://login-callback/
And basically have followed the steps outlined https://supabase.com/docs/guides/getting-started/tutorials/with-flutter#setup-deep-links for the setup of deep links. When the user goes through the auth flow with google the redirect link (altered for brevity) is as follows:
https://PROJECT_ID.supabase.co/com.supabaseAuthSandbox.app#access_token=ACCESSTOKEN&expires_in=3600&provider_token=PROVIDER_TOEKN&refresh_token=REFRESH_TOKEN&token_type=bearer
and gives me the following error on screen {message: "No API Key found in request", "hint": "No `apikey` request header or url param was found
any help would be appreciated, I'm just testing the waters right now on iOS but I wouldn't doubt that the same problem is present on android as well.
Thanksbrad
04/25/2023, 5:35 PMhttps://cdn.discordapp.com/attachments/1100475276938444943/1100475277257228368/image.png▾
Pryapus
04/25/2023, 6:23 PM