How to handle error messages on callback for Custom connected account


I created an add-on for a custom connected account using OAuth 2, based on Xenforo's LinkedIn connector
The log-in works fine for valid accounts.

But if there are some errors returned from the OAuth server, Xenforo will return a plain text error message like "An error occurred while connecting with XXXXX. Please try again later.", or "There is no valid connected account request available. Please try again."

The callback URL looks like this

I would prefer to intercept the errors and redirect the user to the regular login page.
It would be useful if someone can point me to documentation on how to handle these errors

Top Bottom