# Registration is not working correctly

**URL:** <https://community.auth0.com/t/registration-is-not-working-correctly/84467>\
**Category:** Get Help\
**Tags:** registration, verification-email\
**Created:** [June 2, 2022, 9:14am UTC](https://community.auth0.com/t/registration-is-not-working-correctly/84467 "2022-06-02T09:14:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Softwerker04](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/softwerker04/32/37507_2.png) [@Softwerker04](https://community.auth0.com/u/Softwerker04)\
**Post date:** [June 2, 2022, 9:14am UTC](https://community.auth0.com/t/registration-is-not-working-correctly/84467/1 "2022-06-02T09:14:32Z")

</div>

Environment:

- using custom database (Azure SQL)
- using SendGrid account for sending email verification

What happens:  
After I filled out the registration page (username, email, password) and clicked the submit button the user was added to my database. But: no email was sent and at client side the dialog stays in registration mode.

Auth0 log says following:

 ![image](https://global.discourse-cdn.com/auth0/original/3X/8/b/8b66b57936a7c97b0ed959f76381de6fb43c5c80.png)  
Email test ended without exception and everything worked as expected.  
Any ideas?

BTW: same behaviour when I use the “Try Connection” button (custom database scipts)

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [June 10, 2022, 4:08pm UTC](https://community.auth0.com/t/registration-is-not-working-correctly/84467/4 "2022-06-10T16:08:32Z")

</div>

Hi @Softwerker04,

I would suspect this error is coming from your custom DB script. Have you been able to track down the source of the error? [This doc describes how to do that](https://auth0.com/docs/authenticate/database-connections/custom-db/error-handling#troubleshooting-errors).

Additionally, would you please share a code snippet of your custom DB login script?

---

<div class="post-metadata">

**Author:** ![Softwerker04](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/softwerker04/32/37507_2.png) [@Softwerker04](https://community.auth0.com/u/Softwerker04)\
**Post date:** [June 11, 2022, 12:11pm UTC](https://community.auth0.com/t/registration-is-not-working-correctly/84467/5 "2022-06-11T12:11:08Z")

</div>

Hi Dan,

thanks for your answer, it is working now. Currently I have a custom database (SQL Azure), registration and login is working and SendGrid works also in most cases. There is still a problem with some email addresses, but this is just SendGrid stuff. 😉

May be you can tell me what is the best practice to get the ID of logged in user at API side ([ASP.NET](http://ASP.NET) CORE API)? I tried to check HttpContext but I havent’t found the user ID which should come from my own database.  
For example: I have an API method where I have to return a record set regarding to the user who called this method. How would I implement this functionality? Do I have to add a claim with this ID by myself?

EDIT: Found it:

 ![image](https://global.discourse-cdn.com/auth0/original/3X/6/2/620ddf6a6ca5d2ed2a75ce97afe3dc8d82181e1e.png)  
Can be closed now, everything works fine.

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [June 13, 2022, 3:38pm UTC](https://community.auth0.com/t/registration-is-not-working-correctly/84467/6 "2022-06-13T15:38:00Z")

</div>

Great! Glad you were able to find a solution.

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [June 28, 2022, 10:36pm UTC](https://community.auth0.com/t/registration-is-not-working-correctly/84467/7 "2022-06-28T22:36:54Z")

</div>


