I just wanted to say that the new custom authentic...
# prisma-whats-new
l
I just wanted to say that the new custom authentication capabilities are a dream to work with, I'm loving it
💚 3
m
could you share some sample of this, please?
l
I'm mostly dealing with custom email authentication
This one has been particularly useful:
Once you understand the token-based authentication, it's quite simple. And now we have the ability to generate tokens at will and change the user's password, which is what was missing for me
If you have any more questions I'm happy to answer, we've been doing this for a few months now
n
so happy you like it @lastmjs 🙂 I love resolver functions 💚
m
@lastmjs thabk you for the explanation
I already use the email-password authentication
but I'm having problems with the generated token
l
What's the issue?
m
the problem happens when I try to get the logged in user
I’m passing the request header with the token
l
What is the error?
m
but I still think the problem is in the generated token
l
I had to make sure to change the query so that it was working with my exact model
For example, I changed
EmailUser
to
User
in that example
Perhaps you're generating a token for a different entity than you think
graphcool.generateAuthToken(graphcoolUserId, 'User')
That second parameter should be the name of your entity
m
I used this example too
we made the same change
l
Oooh...I don't know then, I haven't run into any issues yet
m
currently you are usung the authentication modules or authentication templates ?
l
I'm manually copying the code from the modules
The templates had some extra confirmation stuff that I didn't want
m
I got it
👍 1
I can’t find my generated token in setting authentication list :/
l
Can you elaborate?
m
of course, after the generation of the token I saved it in the localstorage, so I copied it from there and looked it up in the settings page in the Graphcool console in the authentication tab
and the token is not there
there are some tokens in the list, but this in particular isn’t in the list
l
As far as I know, only permanent auth tokens go into that list. If your project is ejected and you are using the beta graphcool cli, you need to generate the tokens with the cli or in the graphcool.yml file
They'll be accessible to your functions through
event.context.graphcool.pat
or something like that
m
Okay, so I can’t understand what I’m doing wrong
l
@nilan could probably offer more assistance
m
@lastmjs thanks for your help
👍 1
I appreciate that