I just tested this and the steps in the OP worked for me. I added my site’s URL as instructed:
https://test.mydomain.com/auth/discord/callback
And it was accepted with no error. You need to add this in the Oauth2 > Redirects section