<@U04UQ68083H> when a new user registers and a ver...
# ory-copilot
i
@chilly-king-10285 when a new user registers and a verification code is sent. Is it possible that the
return_to
parameter is part of the VerificationURL in the email?
b
A message from kapa.ai
Yes, it is possible for the
return_to
parameter to be part of the VerificationURL in the email sent for user verification. This functionality is supported through the use of the
after_verification_return_to
parameter when initializing the registration flow. According to the [Ory Kratos documentation on post-verification redirection](https://www.ory.sh/docs/kratos/concepts/browser-redirect-flow-completion#post-verification-redirection), you can specify a redirect URL for the verification flow after registration by appending the
after_verification_return_to
parameter to the Browser Registration Init endpoint:
Copy code
<https://public.url/self-service/registration/browser?after_verification_return_to=https://my-redirect/foo>
This parameter allows you to set a custom URL where the user will be redirected after successfully completing the verification process. When using this parameter, the specified URL will be included in the verification email sent to the user. The
VerificationURL
variable available in the email template will contain this redirect information. It's important to note that for security reasons, you may need to whitelist the domain of your
return_to
URL in your Ory Kratos configuration to prevent open redirect attacks, as mentioned in the [Ory Kratos documentation on redirection](https://www.ory.sh/docs/kratos/concepts/browser-redirect-flow-completion#redirection). Remember to handle this redirect appropriately in your application to ensure a smooth user experience after the verification process is completed.