diff --git a/application/api/connector/routes.py b/application/api/connector/routes.py index e65bee55..fb22fe90 100644 --- a/application/api/connector/routes.py +++ b/application/api/connector/routes.py @@ -276,7 +276,11 @@ class ConnectorsCallback(Resource): error = request.args.get('error') if error: - return redirect(f"/api/connectors/callback-status?status=error&message=Authentication+failed.+Please+try+again+and+make+sure+to+grant+all+requested+permissions.&provider={provider}") + if error == "access_denied": + return redirect(f"/api/connectors/callback-status?status=cancelled&message=Authentication+was+cancelled.+You+can+try+again+if+you'd+like+to+connect+your+account.&provider={provider}") + else: + current_app.logger.warning(f"OAuth error in callback: {error}") + return redirect(f"/api/connectors/callback-status?status=error&message=Authentication+failed.+Please+try+again+and+make+sure+to+grant+all+requested+permissions.&provider={provider}") if not authorization_code: return redirect(f"/api/connectors/callback-status?status=error&message=Authentication+failed.+Please+try+again+and+make+sure+to+grant+all+requested+permissions.&provider={provider}") @@ -644,20 +648,23 @@ class ConnectorCallbackStatus(Resource): .container {{ max-width: 600px; margin: 0 auto; }} .success {{ color: #4CAF50; }} .error {{ color: #F44336; }} + .cancelled {{ color: #FF9800; }}