I’m just noticing that the email validation for a ...
# ory-network
l
I’m just noticing that the email validation for a schema using
"format": "email"
isn’t great e.g. The user is able to update their email to
a@a
. Any suggestions for how to improve this?
p
Hi @limited-photographer-61008 You can use webhooks to validate the email on you side on registration and settings flow
You can also write some regex inside the identity schema which does the validation as well
l
Thanks. I was thinking of using a webhook. I didn’t realize the JSON schema email validation was that “weak”.
It might be a good idea to highlight it in the docs, especially since one of the default/example schemas uses it.
@proud-plumber-24205 I am about to start implementing the webhook to validate the email, but it is not clear how I would send the new email value to my endpoint since it doesn’t seem to be available in the
ctx
object. https://www.ory.sh/docs/guides/integrate-with-ory-cloud-through-webhooks#customizing-request-body-with-jsonnet
r
The email addresses are under the
verifiable_addresses
key inside the
identity
of the
ctx
.
l
But if it is a flow-interrupting webhook, I assume that would still be the old email?