<@U04UQ68083H> I am using verification flow to sen...
# ory-copilot
l
@chilly-king-10285 I am using verification flow to send the code over email and then verifying the code using same verificatio flow. After successful verification, do I get the session of the verified user.
c
A message from kapa.ai
The verification flow in Ory does not automatically issue a session for the verified user. The verification flow is primarily used to verify the user's account through their email address. Once the verification flow is submitted successfully, the session has the
identity.verifiable_addresses[0].verified: true
value. However, this does not mean that a session is created for the user. If you want to issue a session after successful verification, you would need to implement this separately. For example, in the context of user registration, Ory allows you to add a session hook which will issue a session after successful registration. This can be done by adding the "session" hook to the after
oidc
registration hooks in your configuration file. Here is an example of how to do this:
Copy code
yaml selfservice:    flows:     registration:      after:       password:        hooks:         - hook: session       oidc:        hooks:         - hook: session # Always enable this for oidc flows or the user experience suffers significantly!
Please note that this example is for user registration and not for the verification flow. The exact implementation might differ based on your specific use case. For more information, you can refer to the [Ory documentation](https://www.ory.sh/docs/kratos/self-service/flows/user-registration#successful-registration).
l
@chilly-king-10285 Tell me particularly for verification flow
c
A message from kapa.ai
Based on the provided extracts, the verification flow in Ory does not automatically issue a session for the verified user. The verification flow is primarily used to verify the user's account through their email address. Once the verification flow is submitted successfully, the session has the
identity.verifiable_addresses[0].verified: true
value, indicating that the email address has been verified. However, this does not mean that a session is created for the user. The session in Ory is issued when a user authenticates, for example by signing in with their username and password. The session is proof that the user is authenticated and allows them to interact with the system without the need to re-authenticate for every request. If you want to create a session for the user after successful verification, you would need to implement this separately, likely as part of a login or authentication flow. For more information, you can refer to the [Ory documentation](https://www.ory.sh/docs/kratos/self-service/flows/user-registration#successful-registration) and [Ory session management overview](https://www.ory.sh/docs/kratos/session-management/overview).