billions-afternoon-15090
12/20/2024, 3:44 AM"code": {
"identifier": true,
"via": "email"
}
brief-egg-61061
12/20/2024, 3:44 AMbrief-egg-61061
12/20/2024, 3:45 AMjson "code": { "identifier": true, "via": "email" }
This change should be part of the <http://ory.sh/kratos|ory.sh/kratos>
section under the credentials
object for the email field in your identity schema. 2. After updating the schema, you need to update the existing identities to use the new schema. This process involves patching the identity with the new schema ID and any necessary trait changes. Here's how you can do it: a. Get the new schema ID (you should have this after creating or updating the schema). b. Use the Ory API to patch the identity. Here's an example using cURL: bash curl --location --request PATCH "https://$<http://ORY_SLUG.projects.oryapis.com/admin/identities/$IDENTITY_ID|ORY_SLUG.projects.oryapis.com/admin/identities/$IDENTITY_ID>" \ --header "Authorization: Bearer $ORY_API_KEY" \ --header "Content-Type: application/json" \ --data-raw '[ { "op": "replace", "path": "/schema_id", "value": "{new-schema-id}" } ]'
Replace $ORY_SLUG
, $IDENTITY_ID
, $ORY_API_KEY
, and {new-schema-id}
with your actual values. 3. Verify that the update was successful by retrieving the identity and checking its schema ID and traits. Remember, updating the schema and patching identities should be done carefully, especially in a production environment. It's recommended to test this process thoroughly in a staging environment first. For more detailed information on updating identities to use a new schema, you can refer to the [Ory documentation on updating identities](https://www.ory.sh/docs/identities/model/manage-identity-schema#update-identities-to-use-a-new-schema).billions-afternoon-15090
12/20/2024, 3:47 AMbillions-afternoon-15090
12/20/2024, 3:48 AMbrief-egg-61061
12/20/2024, 3:48 AMbrief-egg-61061
12/20/2024, 3:48 AMbash curl --location --request PATCH "https://$<http://ORY_SLUG.projects.oryapis.com/admin/identities/$IDENTITY_ID|ORY_SLUG.projects.oryapis.com/admin/identities/$IDENTITY_ID>" \ --header "Authorization: Bearer $ORY_API_KEY" \ --header "Content-Type: application/json" \ --data-raw '[ { "op": "replace", "path": "/schema_id", "value": "default" } ]'
This operation will essentially "refresh" the identity against the current default schema, ensuring it's up to date. 5. After updating, verify that the identity has the correct structure by retrieving it and checking its details. Remember, when working with identity data, it's crucial to be cautious and test thoroughly in a non-production environment first. If you're unsure about any steps, it's always best to consult the [Ory documentation on managing identities](https://www.ory.sh/docs/kratos/manage-identities/overview) or reach out to Ory support for guidance.