Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(server): Oauth callback crash due to query (#3277)
<!-- Describe the problem and your solution --> This is more a hotfix. NAN-2491 is for followup but it's going to take some time to do right. We saw a crash last night around /oauth/callback. I was able to reproduce with this request: ``` curl --request GET --url "https://api-staging.nango.dev/oauth/callback?state=m0626jB2-Mm63-78AR-y5pl-9639066q4c26" ``` This wraps the query that's crashing with a try catch so that we at least get a response. It's a quick and dirty fix that will hopefully get a followup of moving that controller to use asyncWrapper. <!-- Issue ticket number and link (if applicable) --> <!-- Testing instructions (skip if just adding/editing providers) --> Before: ``` ❯ curl --request GET --url "http://localhost:3003/oauth/callback?state=m0626jB2-Mm63-78AR-y5pl-9639066q4c26" curl: (52) Empty reply from server ``` After: ``` ❯ curl --request GET --url "http://localhost:3003/oauth/callback?state=m0626jB2-Mm63-78AR-y5pl-9639066q4c26" {"error":{"message":"An unhandled error of type 'query_error' with payload '{}' has occurred","code":"unhandled_query_error","payload":{}}}% ```
- Loading branch information