<@U04UQ68083H> why does Ory Kratos allow updating ...
# ory-copilot
a
@chilly-king-10285 why does Ory Kratos allow updating the email of the identity?
c
A message from kapa.ai
Ory Kratos allows updating the email of the identity as part of its user settings and profile updates feature. This is important for maintaining accurate and up-to-date user information. It's part of the self-service capabilities of Ory Kratos, which allow users to manage their own account details securely. The email of an identity is considered a trait in Ory Kratos. Traits are part of the identity data model and can be updated through the settings flow. This flow can be initiated by the user through a browser or an API interaction, such as from a mobile app. The update process involves sending a
PUT
request to the
admin/identities/{id}
endpoint with the full identity payload. The updated traits must be valid against the Identity Schema defined for its identity traits. After the update is successful, Ory Kratos responds with a HTTP 200 OK message containing the updated identity. This includes the updated email trait. Sources: - [User settings and profile updates](https://www.ory.sh/docs/kratos/self-service/flows/user-settings) - [Update an Identity API](https://www.ory.sh/docs/kratos/reference/api) - [Successful settings update](https://www.ory.sh/docs/kratos/self-service/flows/user-settings#client-side-browser-clients)
a
@chilly-king-10285 can I prevent a user from changing his email?
c
A message from kapa.ai
Yes, you can prevent a user from changing their email by modifying the Identity Schema in Ory Kratos. The Identity Schema defines which traits (like email) a user can update. If you remove the email field from the schema, users will not be able to update their email. However, please note that this might have implications on the user experience and certain functionalities of your application. For example, if a user loses access to their email account, they might not be able to recover their account if they can't update their email. It's also important to note that the email field is often used for account recovery and verification purposes. If you prevent users from updating their email, you should ensure there are other secure methods for account recovery and verification. Unfortunately, the provided knowledge sources do not include specific instructions or code examples on how to modify the Identity Schema to prevent email updates. For more detailed guidance, you might want to refer to the [Ory Kratos documentation](https://www.ory.sh/docs/kratos/concepts/identity-user-interface#identity-schema).
a
🤯