I tried both {application.callback_domain}
and @@application.callback_domain@@
but what I got is
{"name":"BadRequestError","code":"invalid_result_url","description":"invalid result url: ?supportSignUp=true&supportForgotPassword=true&email=zachguo%40gmail.com&message=Your%20email%20was%20verified.%20You%20can%20continue%20using%20the%20application.&success=true","statusCode":400}
The {application.callback_domain}
syntax is correct, however, you need to take in consideration that if you set a redirect URL that is dependent on the existence of a client application callback URL then the ways you trigger the email need to have context about which client application is being used, in particular:
- if the verification email is being sent as a consequence of a call to
/dbconnections/signup
then the client identifier should be passed in the request payload.
- if the verification email is being sent as a consequence of a call to
/api/v2/jobs/verification-email
then also ensure that the client identifier is passed in the request payload.
If you’re using any of the above methods then also ensure that you have indeed specified at least one callback URL for the client application in question. If you’re using other methods of triggering the email, for example, requesting a verification email directly through the Dashboard then have in mind that currently you’re not allowed to select the scope (client application) associated with the request so that could be the cause of the issue; if I’m not mistaken, technically, when you trigger the verification email through the Dashboard I think the global client is used as context, but since that client does not represent a real client application it’s unlikely to have a callback URL defined so this error would still occur.
That makes sense. Thank you for the detailed answer. I was using user dashboard to create user. Is there a way to specify client when creating new user via dashboard?
Or is there a way to fall back to a default URL if {application.callback_domain} doesn’t exist
That makes sense. Thank you for the detailed answer. I was using user dashboard to create user. Is there a way to specify client when creating new user via dashboard?
Or is there a way to fall back to a default URL if {application.callback_domain} doesn’t exist
To my knowledge that is not supported at this time.
You can try the following: {% if {application.callback_domain} == "" or {application.callback_domain} == nil %} https://default.example.com {% else %} {{application.callback_domain}} {% endif %}