Hi, is it possible to sanitize custom identity sch...
# ory-network
f
Hi, is it possible to sanitize custom identity schema strings like removing links in the name?
m
You can use regex in the identity schema to disallow some patterns. For example
Copy code
"username": {
  "type": "string",
  "minLength": 6,
  "maxLength": 32,
  "pattern": "^[a-zA-Z0-9]*$",
  "title": "Username",
  }
If you use this method we recommend to customize the error on the client side, see https://www.ory.sh/docs/kratos/concepts/ui-user-interface#titles-labels--validation-messages
s
You can also use webhooks for more advanced validation.
👍 1
f
Thanks, that helps