chatwoot/app/controllers
Vinícius Fitzner b791d75b30
fix(microsoft): prevent OAuth admin consent loop (#13962)
Fixes #9775

## Description

This fixes a repeated admin consent loop in the Microsoft OAuth flow
when connecting a Microsoft email inbox.

Chatwoot was always sending `prompt=consent` in the Microsoft
authorization URL. In the current code path, this parameter is only used
when building the authorization URL and is not required by the callback,
token exchange, token persistence, or refresh flow.

By removing the forced consent prompt, the OAuth flow can proceed
normally without repeatedly sending users back through the admin consent
screen.

## What changed

- removed `prompt: 'consent'` from the Microsoft authorization URL
- added a regression assertion to ensure `prompt` is not included in the
generated URL

## Why this is safe

- `redirect_uri`, `scope`, and `state` remain unchanged
- callback and token exchange flow remain unchanged
- refresh token flow remains unchanged
- no other part of the current Microsoft inbox flow depends on forcing a
consent screen

## Testing

- updated controller spec to assert that the generated authorization URL
does not include `prompt`
2026-06-03 12:05:25 +05:30
..
api fix(microsoft): prevent OAuth admin consent loop (#13962) 2026-06-03 12:05:25 +05:30
auth feat: ensure signup verification [UPM-14] (#13858) 2026-04-07 13:45:17 +05:30
concerns fix: added HMAC validation for Whatsapp and Instagram webhooks (#14280) 2026-05-05 15:01:11 +05:30
devise_overrides fix: Implement resend confirmation feature for login page (#11970) 2026-05-07 15:13:04 +05:30
google feat: use of imap login as default if present (#10249) 2024-10-09 15:01:11 +05:30
instagram feat(onboarding): honor return_to hint in Instagram OAuth callback (#14568) 2026-06-02 15:28:08 +05:30
installation feat: Unify user and super admin credentials (#3830) 2022-01-25 16:58:49 -08:00
linear feat(linear): Support refresh tokens and migrate legacy OAuth tokens (#13721) 2026-03-17 13:09:03 +04:00
microsoft fix: use UPN for imap_login on Microsoft OAuth callback (#14522) 2026-06-02 13:26:30 +05:30
notion feat: Whatsapp embedded signup (#11612) 2025-07-14 21:37:06 -07:00
platform/api/v1 fix(agent-bots): destroy permissibles on AgentBot deletion and skip orphans in index (#14273) 2026-04-27 19:17:32 +05:30
public/api/v1 feat: Implemented search results page functionality (#11086) 2026-06-02 15:19:23 +05:30
shopify feat(apps): Shopify Integration (#11101) 2025-03-19 15:37:55 -07:00
super_admin feat: Refresh llm settings when superadmin configs change [AI-151] (#14388) 2026-05-18 14:08:26 +05:30
survey feat: Add INSTALLATION_NAME to global config (#12376) 2025-09-09 12:13:35 +05:30
tiktok feat(onboarding): honor return_to hint in TikTok OAuth callback (#14569) 2026-06-02 13:24:46 +05:30
twilio feat: Store WhatsApp BSUID identifiers from inbound webhooks (#14436) 2026-05-20 13:36:43 +04:00
twitter fix: response body in twitter callback (#6907) 2023-04-14 16:48:28 +05:30
webhooks fix: added HMAC validation for Whatsapp and Instagram webhooks (#14280) 2026-05-05 15:01:11 +05:30
android_app_controller.rb chore: Universal Linking for Android (#2324) 2021-06-02 08:46:45 -07:00
api_controller.rb chore: Upgrade to Rails 7 (#6719) 2023-05-06 10:44:52 +05:30
apple_app_controller.rb Chore: Apple site association file for deep linking (#805) 2020-05-03 12:16:11 +05:30
application_controller.rb feat: Conversation API to return applied_sla and sla_events (#9174) 2024-04-01 23:30:07 +05:30
dashboard_controller.rb feat: Add platform-wide status banners for outage notifications (#13943) 2026-04-29 17:18:38 +04:00
health_controller.rb feat: add lightweight /health endpoint (#13386) 2026-01-29 00:24:01 +05:30
microsoft_controller.rb chore: Automate SSL with Cloudflare (#12021) 2025-07-24 13:09:06 +04:00
oauth_callback_controller.rb feat(onboarding): honor return hint in email OAuth callback (#14567) 2026-06-02 14:21:11 +05:30
platform_controller.rb Chore: Inbox Members API improvements (#3008) 2021-09-14 11:55:02 +05:30
public_controller.rb feat: disable helpcenter on hacker plans (#12068) 2026-03-26 23:48:46 -07:00
slack_uploads_controller.rb fix: handle active storage preview error for password protected pdfs (#11888) 2025-08-11 12:41:37 +05:30
swagger_controller.rb fix(swagger): prevent path traversal in docs controller (#14458) 2026-05-14 18:52:14 +05:30
widget_tests_controller.rb feat: Support Dark mode for the widget (#4137) 2022-04-01 20:59:03 +05:30
widgets_controller.rb feat(widget): Allow widget loading in mobile app WebViews when domain restrictions are set (#13763) 2026-03-17 14:29:41 +04:00