I have this code here: ```js const { data1, error1...
# help
s
I have this code here:
Copy code
js
const { data1, error1 } = await supabase
        .from('activationkeys')
        .select("*")
        .eq('key', body.activationKey)
Used to fetch if there is a key in supabase. No matter what I do, no data is returned at all. Any ideas on when this would happen?
n
Hello @sticks! This thread has been automatically created from your message in #843999948717555735 a few seconds ago. We have already mentioned the @User role so that they can see your message and help you as soon as possible! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ... menu) and select Leave Thread to unsubscribe from future updates. Want to change the title? Use the /title command! We have solved your problem? Click the button below to archive it.
g
Well first issue {data1, error1} won't work. you need {data:data1, error:error1} to map the return keys. Next thing to look at would be if you don't meet RLS policy.
n
sticks (2022-05-03)
s
Okay. Fixed that issue, but now my signup does not work right?
Copy code
// Trigger auth signup
    const {user, session, error2} = await supabase.auth.signUp({
        email: body.email,
        password: body.password
    })
No Email, nothing
user
and
session
are null
g
well at a minimum make error2 error:error2 and see if you have an error
Your comment about no email implies you have settings on the server set to email confirmations turned on. Is that true?
s
ye should be - seems it's not likeing the password
g
There is a length requirement I remember, not sure what else.
s
yeah, was length. Fixed it
Thanks for all of your help!
oh also, how do you verify an email?
is there a call you have to do
g
Just remember when you use {} you are taking the return object (myObject = await.....) and pulling out of it keys in that object. You can use : to alias the keys.
What do you mean verify email?
s
well it sends you the email saying
Hey! Click this link
g
Without refreshing my memory, I believe supabase.js will handle the link and use the token in the link to confirm the user on the server and then set the signin event in onAuthStateChange.
s
so just load the client on your verification page?
g
Yes, gotrue will look at the url for the info as long as you don't change this default option detectSessionInUrl: true