battlesheep123
06/26/2022, 11:46 AMGΓΌnhan
06/26/2022, 12:16 PMconst { data: randomAnswers, error: answersError } = await this.$supabase.from('random_answers').select('id, text').not('id', 'in', `(${currentAnswersInHandsIDs})`)
this gave me, first error.
but this worked.
const { data: randomAnswers, error: answersError } = await this.$supabase.from('random_answers').select('id, text').not('id', 'in', `(${currentAnswersInHandsIDs.join(',')})`)
docs says i can use js array, why my first code did not work? any ideas?
thank you very much.silentworks
06/26/2022, 1:47 PMgaryaustin
06/26/2022, 2:29 PMtylergannon
06/26/2022, 5:32 PMsignIn()
to fully instantiate the client?
I'd like to be able to use the SupabaseClient
on my API server. Clients send the JWT and refresh token in an HttpOnly cookie. The trick is that I don't know how to authorize the SupabaseClient
object without calling signIn()
.
I'm hoping to be able to avoid that extra trip to Supabase on every API call, and I don't want to keep an open SupabaseClient object for each session.tylergannon
06/26/2022, 5:37 PMstijn
06/26/2022, 9:08 PMpersistSession: true
, it stores the session in localStorage which isn't great security wise. While I'm not sure it's 100% safe I thought it might be better to instead store the refresh-token in a cookie and use this to persist the session?
Is it possible to authenticate with a refresh token?
Does anybody know other/better ways to securely persist session?
All advice and related resources are appreciated:)Devr
06/28/2022, 12:21 PMjaitaiwan
06/28/2022, 2:45 PMlumen
06/29/2022, 12:57 PMgetServerSideProps()
like so:
javascript
import { getUser } from '@supabase/auth-helpers-nextjs'
import prisma from 'prisma/prismaClient'
export async function getServerSideProps({ params, req, res }) {
// Check whether the user owns this course
let ownsCourse = false
const { user } = await getUser({ req, res }) // Access the user object
if (user) {
const profile = await prisma.profile.findUnique({
where: { id: user.id },
include: { courses: true },
})
ownsCourse = profile.courses.some((c) => c.courseId === courseSlug)
}
[...]
}
My problem is that when the user logs in, and is redirected back to my website, they still see the logged out version of the page (with the paywall). They have to reload the page manually to see the signed in version.
I'm guessing that happens because after the user is redirected back to my website, getServerSideProps()
sees that they don't have any auth cookies yet, so it renders the signed out version of the page. Then the frontend code realizes that I just logged in, and sets the auth cookies, but at this point the page has already been rendered.
Can you please share some advice? How can I solve this?Miguel Espinoza
06/29/2022, 5:55 PMchrome.runtime.sendMessage
I was under the impression I had to sync session tokens between my extension background and content_script, but after some fiddling and using supabase.auth.onAuthStateChange
I noticed supabase takes care of that. In other words, I'm initializing supabase in the background and without any additional code, supabase in the content_script is initialized. Kinda neat! I imagine there's some message handling? I was checking if anyone is familiar with this behavior and if there are docs to help clarify this.
My main concern is ensuring that the refresh_token is in sync between the background and content_script. Thanks!Miguel Espinoza
06/29/2022, 6:06 PMhelewud
06/29/2022, 6:42 PMgaryaustin
06/29/2022, 10:03 PMole
06/30/2022, 8:15 PMexport const getStaticProps = async () => {
const {data:product} = await supabase.from("products").select('*')
return {
props: {
product,
},
};
};
ole
06/30/2022, 8:16 PMsilentworks
06/30/2022, 11:00 PMShoki
07/01/2022, 2:55 PMjs
const { data } = await supabase
.from("images_metadata")
.select()
.contains("tags", [text])
const { data } = await supabase
.from("images_metadata")
.select()
.like("title", text);
but i would like to use contains
and like
at the same time like this:
js
const { data } = await supabase
.from("images_metadata")
.select()
.contains("tags", [text])
.like("title", text);
so this query will return all the elements which contains text
in tags
and text
in title
is it possible ?rchrdnsh
07/01/2022, 5:05 PMgaryaustin
07/01/2022, 5:59 PMkresimirgalic
07/01/2022, 6:55 PMconst { data, error } = supabase
.from('project_time_entries')
.select(`*, project: project_id(*), client: client_id(*)`)
.rangeGt('work_date', [
dayjs(date[0]).format('YYYY-MM-DD'),
dayjs(date[1]).format('YYYY-MM-DD'),
])
Relisora
07/02/2022, 9:38 PMMV_2021
, MV_2022
etc... Now I have one request that does this:
js
.from(`MV_${this.year}`)
.select(
`
*,
clients:b_client_id!inner(id, name, slug, image_filename)
`
)
.eq('a_client_id', this.client.id)
It basically represents every relation each client had with every client. I want the stats of the relations of one client.
The issue is that... Sometimes it works and sometimes not, my MV_2021
works but not MV_2022
nor MV_2021
. I created them all with the same query just changing the year, and I already tried deleting them all and creating them, different views work but never all of them.
The error message is:
Could not find a relationship between 'MV_2022' and 'b_client_id' in the schema cache
The query for every year works all the time if I try them in raw SQL.
Can someone please help? I ran out of options to tryRelisora
07/02/2022, 9:44 PMRelisora
07/02/2022, 9:46 PMsebx
07/03/2022, 8:39 AMRelisora
07/03/2022, 10:32 AMRoshan J.
07/03/2022, 11:57 AMyaman
07/03/2022, 12:02 PMyaman
07/03/2022, 12:02 PMyaman
07/03/2022, 12:03 PM