How to handle error messages on callback for Custom connected account

hoks

Member
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
/connected_account.php?errorCode=XXXXX0001&errorMessage=timeout&state=4db0363a8c19e745484eddfbb8141af8

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

Thanks
 
Top