chatwoot/spec/controllers/api
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
..
v1 fix(microsoft): prevent OAuth admin consent loop (#13962) 2026-06-03 12:05:25 +05:30
v2 feat(rollup): report builder abstraction [2/3] (#13798) 2026-04-20 11:15:48 +05:30
base_controller_spec.rb feat: Add an API to support querying metrics by ChannelType (#13255) 2026-01-12 23:18:47 -08:00