You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've followed the Email+Password Auth tutorial and would like to know if it's possible to get the identity id of the user when it registers (before verifying the email).
The code in question is the following in the tutorial:
After this fetch call, the user is correctly registered in the database, but the fetch response only contains the field verification_email_sent_at. I have created a User type that has a link to ext::auth::Identity and would like to create an entry when the user registers, but I have no way of knowing the identity id of the newly registered user to create an entry of type User.
Here's my type:
type User {
required name: str;
required identity: ext::auth::Identity;
}
I'm trying the following after the successful registration:
e.insert(e.default.User,{name: body.name,identity: // How can I link up to the newly registered user here? }
Looking at the code that handles the registration, it looks like EdgeDB should be able to return the identity of the registered user to the client. Is there a reason for not doing it? Something like this:
The point of require_verification is that you do not get the Identity and the auth token before the user verifies their email. If you would like access that information, you can set require_verification to false in your provider config. See https://docs.edgedb.com/guides/auth#email-and-password for more details on how to do that.
But I don't want the auth_token. It makes sense not to get the auth_token until the user verifies their email (especially if require_verification is true).
I've checked and the identity row is created in EdgeDB when the user is created but not verified. I want the ID associated with that user to do some extra work in the backend.
I've followed the Email+Password Auth tutorial and would like to know if it's possible to get the
identity
id of the user when it registers (before verifying the email).The code in question is the following in the tutorial:
After this
fetch
call, the user is correctly registered in the database, but the fetch response only contains the fieldverification_email_sent_at
. I have created a User type that has a link toext::auth::Identity
and would like to create an entry when the user registers, but I have no way of knowing the identity id of the newly registered user to create an entry of type User.Here's my type:
I'm trying the following after the successful registration:
Looking at the code that handles the registration, it looks like EdgeDB should be able to return the
identity
of the registered user to the client. Is there a reason for not doing it? Something like this:The text was updated successfully, but these errors were encountered: