franfernandez
05/16/2022, 9:40 PMjs
export default async function handler (req, res) {
const { access_token } = req.get('X-Supabase-Auth')
const { user, error } = supabase.auth.setAuth(access_token)
console.log('error', error)
console.log('user', user)
}
but with NextJs middleware is becoming difficult, req.get
is not defined. There are some documentation about this behaviour.WhatTheEffffMan
05/16/2022, 11:51 PMflux;
05/17/2022, 1:28 AMian_
05/17/2022, 2:23 AMpermission denied for table identities
, probably because my RLS policy does a lookup in the identities table. how can I change the RLS policy to let someone lookup their own identity?AlanK
05/17/2022, 5:56 AM[POST] /api/auth/signin
14:25:55:71
2022-05-17T04:25:56.345Z 9224560d-5da7-4630-8ecf-2c93d7755e57 ERROR Error: Dynamic require of "stream" is not supported
at file:///var/task/index.js:12:9
at node_modules/node-fetch/lib/index.js (file:///var/task/index.js:7860:35)
at __require2 (file:///var/task/index.js:18:50)
at node_modules/cross-fetch/dist/node-ponyfill.js (file:///var/task/index.js:8927:21)
at __require2 (file:///var/task/index.js:18:50)
at node_modules/@supabase/gotrue-js/dist/main/lib/helpers.js (file:///var/task/index.js:8981:41)
at __require2 (file:///var/task/index.js:18:50)
at node_modules/@supabase/gotrue-js/dist/main/GoTrueApi.js (file:///var/task/index.js:9090:21)
at __require2 (file:///var/task/index.js:18:50)
at node_modules/@supabase/gotrue-js/dist/main/index.js (file:///var/task/index.js:10191:39)
2022-05-17T04:25:56.349Z
Does anyone have any ideas?magoz
05/17/2022, 6:20 AMhttp://localhost:3000/?error=server_error&error_description=Error+getting+user+email+from+external+provider
Am I doing something wrong?
What's the right way of setting up Twitter Oauth?
I'm attaching screenshots of my Twitter Dashboard setup.Mattyfaz
05/17/2022, 7:08 AM@nuxtjs/supabase
module, trying to setup a really basic auth.
On my login page I have:
javascript
const login = async () => {
await auth
.signIn({
email: email.value,
password: password.value,
})
.then(() => {
router.push("/");
})
.catch((error) => {
return alert(error);
});
};
On the index page I have the following calling middleware:
javascript
definePageMeta({
middleware: "auth",
});
And the auth
middleware is:
javascript
export default defineNuxtRouteMiddleware((to, _from) => {
const user = useSupabaseUser()
if (!user.value) {
console.log("User not authenticated")
return navigateTo('/login')
}
})
When I login, the middleware fails and says "User not authenticated". However it actually has, if I refresh I am logged in.
It's almost like the middleware just acts too quickly and needs to wait a second.
Any idea how to resolve this?BAN
05/17/2022, 9:04 AMauth.users
in supabase db. does changing role trigger it or is it due to something else.alexey.matveev
05/17/2022, 10:54 AMd33pu
05/17/2022, 12:16 PMMattyfaz
05/17/2022, 12:36 PMaslop2
05/17/2022, 1:32 PMexists (
select 1
from collection
where auth.uid() in collection.user_ids
)
Ben-jam-in
05/17/2022, 5:43 PMsudoramen
05/17/2022, 7:13 PMmessages
but const sub = supabase.from('messages').on("*", console.log).subscribe()
never prints anything. Is there something I'm missing? Thank you for any help!joshcowan25
05/17/2022, 7:45 PMscottsaavarie
05/17/2022, 10:35 PMMissing or invalid credentials.
agileben
05/18/2022, 1:42 AMVuNguyen
05/18/2022, 2:37 AMhenryholtgeerts
05/18/2022, 2:47 AMcasualgardener
05/18/2022, 3:26 AMDots
05/18/2022, 3:57 AMNeedle
05/18/2022, 9:05 AMd33pu
05/18/2022, 9:06 AMJohnC
05/18/2022, 10:44 AMnorman
05/18/2022, 12:25 PMpg_graphql
extension.
when I run the query in the sql editor, it will response me data.
but when I try to use postman call the query it returns me an error.
Sql Editor
select graphql.resolve($$
{
usersCollection(first: 1) {
edges {
node {
id
}
}
}
}
$$);
result
{
"data": {
"usersCollection": {
"edges": []
}
}
}
postman request
query{
usersCollection(first: 1) {
edges {
node {
id
}
}
}
}
postman response
{
"data": null,
"errors": [
{
"message": "Unknown field 'usersCollection' on type 'Query'"
}
]
}
Hausik
05/18/2022, 12:46 PMPaul
05/18/2022, 1:37 PMtimestampz
to just date / time / zone? I have tried .toLocaleString
but it doesn't seem to workNeedle
05/18/2022, 3:43 PMavalanche
05/18/2022, 3:48 PMderpwingduk
05/18/2022, 4:29 PM