bland-finland-95044
10/28/2024, 2:40 PMbrief-egg-61061
10/28/2024, 2:40 PMbrief-egg-61061
10/28/2024, 2:40 PMyaml selfservice: flows: settings: after: password: # redirect after successfully updating the password in settings default_browser_return_url: <https://end-up-here-after-login-with-password/>
In this configuration, after a user successfully updates their password in the settings flow, they will be redirected to the URL specified in the default_browser_return_url
under the password
section [Docs > Concepts > Browser redirects and flow completion > Redirect flows](https://www.ory.sh/docs/concepts/redirects#redirect-flows). It's important to note that this setting overrides any default redirect URL that might be set at a higher level in the configuration hierarchy. This allows for fine-grained control over user redirection based on specific actions within the settings flow.bland-finland-95044
10/28/2024, 2:52 PMbrief-egg-61061
10/28/2024, 2:52 PMbrief-egg-61061
10/28/2024, 2:52 PMprivileged_session_max_age
setting. By setting this to a very short duration or to zero, you can effectively disable the ability to change the email address without re-authentication. Here's how you can configure this: yaml selfservice: flows: settings: # Set this to a very short duration or to zero privileged_session_max_age: 0s
By setting privileged_session_max_age
to zero, any attempt to change privileged fields (including the email address) will require immediate re-authentication, effectively disabling the ability to change these fields on the settings page without logging in again [Docs > Kratos > Self-service > Flows > Settings and profile updates > Updating privileged fields](https://www.ory.sh/docs/kratos/self-service/flows/user-settings#updating-privileged-fields). It's important to note that this approach doesn't completely remove the field from the settings page, but it makes it practically impossible to change without re-authentication. If you want to completely remove the ability to change the email address, you might need to customize your user interface to not display this option. Remember that disabling email address changes might impact user experience and account recovery options, so consider the implications carefully before implementing this restriction.bland-finland-95044
10/28/2024, 8:31 PMbrief-egg-61061
10/28/2024, 8:31 PMbrief-egg-61061
10/28/2024, 8:31 PMimmutable
property in the JSON Schema for the identity. Here's an example of how you can make the email field immutable: json { "$id": "<https://example.com/registration.schema.json>", "$schema": "<http://json-schema.org/draft-07/schema#>", "title": "Person", "type": "object", "properties": { "traits": { "type": "object", "properties": { "email": { "type": "string", "format": "email", "title": "E-Mail", "<http://ory.sh/kratos|ory.sh/kratos>": { "credentials": { "password": { "identifier": true } }, "verification": { "via": "email" } }, "maxLength": 320, "immutable": true } }, "required": ["email"] } } }
In this example, we've added the "immutable": true
property to the email field. This means that once the email is set during user creation, it cannot be changed in subsequent updates to the identity [Docs > Kratos > Manage-identities > Customize identity schemas > Examples > Email as the primary identifier](https://www.ory.sh/docs/kratos/manage-identities/customize-identity-schema#examples). By setting a field as immutable, you ensure that it remains constant throughout the lifecycle of the identity, even if attempts are made to modify it through the settings flow or API calls. Remember that making critical fields like email immutable can impact user experience and account management processes, so consider the implications carefully before implementing this restriction.bland-finland-95044
10/28/2024, 8:35 PMbrief-egg-61061
10/28/2024, 8:35 PMbrief-egg-61061
10/28/2024, 8:36 PM