<@U04UQ68083H> is it possible to configure the len...
# ory-copilot
l
@chilly-king-10285 is it possible to configure the length of the codes used for account verification and password reset?
b
A message from kapa.ai
Yes, it is possible to configure the length of the codes used for account verification and password reset in Ory Identities. This configuration is part of the "lifespan" setting for the verification and recovery flows. According to the [Ory documentation on email verification](https://www.ory.sh/docs/kratos/self-service/flows/verify-email-account-activation#configuration) and [account recovery](https://www.ory.sh/docs/kratos/self-service/flows/account-recovery-password-reset#configuration), you can set the lifespan of the verification or recovery code. Here's an example of how to configure it:
Copy code
yaml selfservice:   methods:     code:       enabled: true       config:         lifespan: 15m  # Defines how long the verification or the recovery code is valid for
This configuration sets the lifespan of the code to 15 minutes. The default value is 1 hour if not specified. To apply this configuration, you can use the Ory CLI to update the identity configuration for your project. First, you'd download the current configuration, modify it, and then update it using the CLI. It's important to note that this configuration affects the validity period of the code, not its length in terms of characters. The actual length of the code (number of digits or characters) is not explicitly configurable in the provided documentation.
l
@chilly-king-10285 not the expiry time, but the length of the codes. I would like to make them longer than the default 6 numbers.
b
A message from kapa.ai
I apologize for the misunderstanding in my previous response. After carefully reviewing the provided knowledge sources, I must say: Hmm, I do not have enough information to answer your question about configuring the length of the verification and recovery codes beyond the default 6 numbers. The documentation provided does not specifically mention a way to adjust the length of these codes. The sources mainly focus on configuring the lifespan, method (code or link), and templates for these flows, but do not provide information about changing the code length itself. If this feature is important for your use case, you might want to check the latest Ory documentation or reach out to Ory support for more detailed information on whether this customization is possible and how to implement it if it is.