nhost / hasura-auth

Authentication for Hasura.
https://nhost.io
MIT License
372 stars 110 forks source link

/token failing for user with Empty email #525

Closed blib closed 3 weeks ago

blib commented 3 weeks ago

/token is failing email validation when email is set to null

dbarrosop commented 3 weeks ago

hi, thanks for the PR. What is the use case for this change?

blib commented 3 weeks ago

Anonymous user with null email trying to get session with refresh token fails on email validation (which is null)

blib commented 3 weeks ago

issue is with the implementation of the types.Email type's MarshalJSON function. The current implementation validates the email address against a regular expression, which fails for the valid use case of an empty email.

dbarrosop commented 3 weeks ago

could you rebase also, please? I have a fix in main that I think/hope will fix the CI

etodanik commented 3 weeks ago

@dbarrosop what are the chances for it to land? It became a breaking issue for us, we can't use nhost unless this lands because our app is phone-only authentication.

dbarrosop commented 3 weeks ago

Thanks for raising the issue and for the PR. This should be fixed in #529

blib commented 3 weeks ago

thank you for you great work! Your fix is much cleaner!