AskarNab
05/03/2023, 7:49 PMhttps://cdn.discordapp.com/attachments/1103408104114225233/1103408104286208141/image.png▾
tonyroma
05/03/2023, 8:34 PMKiwiHour
05/03/2023, 8:57 PMhttps://cdn.discordapp.com/attachments/1103425241566412890/1103425241696448523/image.png▾
https://cdn.discordapp.com/attachments/1103425241566412890/1103425241973276763/image.png▾
davout
05/03/2023, 8:58 PMJolly Joy
05/03/2023, 9:13 PMAmusedGrape
05/03/2023, 10:19 PMdave
05/03/2023, 11:05 PMauth.admin.signOut
supposed to stop? Even after signing out, I'm still able to update the user... which doesn't make sense to me.
typescript
const { error } = await supabase_client_admin.auth.admin.signOut(session.data.session.access_token);
console.debug(`error: ${JSON.stringify(error, null, 2)}`);
const supabase_client_newtmp = createClient(c.env.SUPABASE_URL, c.env.SUPABASE_KEY, {
auth: {
persistSession: false
}
})
await supabase_client_newtmp.auth.setSession({
access_token: session.data.session.access_token,
refresh_token: session.data.session.refresh_token
})
// This should fail, no?
const updated_result = await supabase_client_newtmp.auth.updateUser({
data: {
demo: Date.now().toString()
}
})
console.debug(`updated_result: ${JSON.stringify(updated_result, null, 2)}`);
IvLa
05/04/2023, 12:15 AMaccess_token
field as the jwt token? and use that to verify the user and have them be logged in etcRomstar
05/04/2023, 12:54 AMIvLa
05/04/2023, 1:01 AMpy
@app.get("/login")
async def login_with_discord(response: Response):
oauth_flow = supabase_client.auth.sign_in_with_oauth({"provider": "discord"})
oauth_url = oauth_flow.url
response = RedirectResponse(url=oauth_url)
return response
@app.get("/")
async def home(request: Request):
user = supabase_client.auth.get_session()
print(user)
return
Currently user prints None
. Supabase is redirecting the user to the "/" endpoint with the anchors at the end of the url but I can't access those obvi. So how do I set the users session??Romstar
05/04/2023, 1:09 AMtk
05/04/2023, 1:32 AMBEGIN;
ALTER POLICY "Enable read access for all users" ON "public"."profiles" USING ((id = auth.uid());
COMMIT;
I am not able to update the 'subscribed_status' which is on the profiles table.
but when I have this :
BEGIN;
ALTER POLICY "Enable read access for all users" ON "public"."profiles" USING true;
COMMIT;
The functionality does work as expected and I am able to update the.
I included a few log statements where I update the field and the log statements are saying that it is working, however the database itself is not updating
Fetching subscribed status for user with ID: 22f46b47-94de-439f-9db4-341795442847
feed.tsx:151 Current subscribed status for user: false
feed.tsx:153 Updating subscribed_status for user with ID: 22f46b47-94de-439f-9db4-341795442847
feed.tsx:167 Subscribed status updated successfully
I have no idea what could be going on, and would appreciate any help.
(I have checked this is the right user, and both auth and profile are using uuid for id)
xuanwo
05/04/2023, 1:35 AMMashwishi
05/04/2023, 3:38 AMtsx
const { data } = await supabase
.from('chats')
.insert({ message: newTodo, user_id: session.user.id })
.from('user')
.update({ coins: userCoins - 10 }).eq('id', session.user.id)
.select()
ven
05/04/2023, 3:49 AMKai___
05/04/2023, 4:49 AMRB_Gaura
05/04/2023, 6:24 AMcrimsen
05/04/2023, 9:19 AMhttps://cdn.discordapp.com/attachments/1103611847673925704/1103611847896203274/1.png▾
https://cdn.discordapp.com/attachments/1103611847673925704/1103611848139485305/22.png▾
https://cdn.discordapp.com/attachments/1103611847673925704/1103611848445677628/3.png▾
https://cdn.discordapp.com/attachments/1103611847673925704/1103611848688926740/4.png▾
Lucas974
05/04/2023, 9:26 AMimport { useRouter } from 'next/router';
import { useEffect } from 'react';
import { useUser, useSupabaseClient } from '@supabase/auth-helpers-react';
import { Auth } from '@supabase/auth-ui-react';
import { ThemeSupa } from '@supabase/auth-ui-shared';
import LoadingDots from '@/components/ui/LoadingDots';
import Logo from '@/components/icons/Logo';
import { getURL } from '@/utils/helpers';
const SignIn = () => {
const router = useRouter();
const user = useUser();
const supabaseClient = useSupabaseClient();
useEffect(() => {
if (user) {
router.replace('/account');
}
}, [user]);
if (!user)
return (
<div className="flex justify-center height-screen-helper">
<div className="flex flex-col justify-between max-w-lg p-3 m-auto w-80 ">
<div className="flex justify-center pb-12 ">
<Logo width="64px" height="64px" />
</div>
<div className="flex flex-col space-y-4">
<Auth
supabaseClient={supabaseClient}
providers={[]}
redirectTo={getURL()}
magicLink={true}
appearance={{
theme: ThemeSupa,
variables: {
default: {
colors: {
brand: '#404040',
brandAccent: '#52525b'
}
}
}
}}
theme="dark"
/>
</div>
</div>
</div>
);
return (
<div className="m-6">
<LoadingDots />
</div>
);
};
export default SignIn;
Thank's!TrickyMick
05/04/2023, 9:29 AMHhorn
05/04/2023, 10:22 AMDannyDanDan
05/04/2023, 10:33 AMReditusDei-
05/04/2023, 11:17 AMgoldyman
05/04/2023, 1:27 PMGrimmjoww231
05/04/2023, 2:18 PMPalsson
05/04/2023, 2:33 PMhttps://cdn.discordapp.com/attachments/1103690967745302528/1103690967862747238/image.png▾
dave
05/04/2023, 3:07 PMOtpLength
for the mailer?
https://cdn.discordapp.com/attachments/1103699378566336544/1103699379073843290/image.png▾
JoseProGDP
05/04/2023, 3:42 PMerror sending request for url (http://localhost:54321/auth/v1/admin/users?page=&per_page=): error trying to connect: tcp connect error: Cannot assign requested address (os error 99)
The code I am using is:
javascript
serve(async (_) => {
const res = await supabase.auth.admin
.listUsers();
return new Response(JSON.stringify(res), {
status: 200,
headers: { ...corsHeaders, "Content-Type": "application/json" },
});
});
And I'm initializing the supabase
client like so:
javascript
const supabase = createClient(
"http://localhost:54321",
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImV4cCI6MTk4MzgxMjk5Nn0.EGIM96RAZx35lJzdJsyH-qQwv8Hdp7fsn3W0YpN81IU",
{
auth: {
autoRefreshToken: false,
persistSession: false,
},
},
);
If I do the same thing on the client, rather than from a Deno edge function, it works. I only get this error from Deno-side.
I know the function is deploying correctly, because I do get the response, just without the user data.Epailes
05/04/2023, 4:06 PMJacko
05/04/2023, 4:32 PM