## Problem
When a returning app changes its permissions, the consent screen mixes
old and new access levels in a list of parenthetical labels.
## Solution
Show added, removed and unchanged permissions in their access groups. A
level change appears in both the old and new groups. Green comes from
the success token so it stays green across accent settings.
| Before | After |
| --- | --- |
| <img width="868" height="2164" alt="CleanShot 2026-11-20 at 12 40
23@2x"
src="https://github.com/user-attachments/assets/74e8462c-60eb-44c5-be25-7e683083be8d"
/> | <img width="866" height="1986" alt="CleanShot 2026-11-20 at 12 38
47@2x"
src="https://github.com/user-attachments/assets/a739e619-8fc7-4a91-9a28-4b3c176b882b"
/> |
## Review instructions
1. **Before:** Open the [Scoped OAuth
tester](https://api.supabase.green/v1/oauth/authorize?response_type=code&client_id=a3999bfe-cfc7-4584-9c5a-ab6828d35aa3&redirect_uri=http%3A%2F%2Flocalhost%3A8765%2Foauth%2Fcallback)
and leave consent open.
2. **After:** Open the [deploy preview consent
screen](https://studio-staging-git-dnywh-oauth-permission-diff-supabase.vercel.app/dashboard/authorize?auth_id=606dbb8e-60ea-4155-bb36-70a7d31378dd).
**What to check**
1. Open Chrome DevTools → **Network** → **Fetch/XHR**, filter by the
`auth_id` in the consent URL, and reload. Right-click each of these two
**GET** requests and select **Override content**. Choose a local
Overrides folder if Chrome prompts you.
- `/api/platform/oauth/authorizations/<auth_id>` is the new request. Set
its top-level `scopes` to
`["database:read","database:write","projects:read","storage:read"]`.
-
`/api/platform/organizations/<org-slug>/oauth/authorizations/<auth_id>/preflight`
is the existing grant check. In that response, replace
`"existing_grant": null` with this field and leave the rest of the
response intact.
```json
"existing_grant": {
"grant_id": "00000000-0000-4000-8000-000000000001",
"approved_scopes": ["database:read", "projects:read", "secrets:read"],
"project_refs": null,
"approved_at": "2026-11-19T00:00:00.000Z"
},
```
2. Keep the other fields as returned. Save both overrides and reload
with DevTools open.
3. Check that Database management is removed from **Read only** and
added to **Read and write**, Projects is unchanged, Storage is added,
and Secrets is struck through. Clear the overrides when done.
## Problem
The OAuth apps consent screen may show an empty _Already granted_
section in the permissions diff
<img width="802" height="474" alt="image"
src="https://github.com/user-attachments/assets/f49bca9e-20da-4554-83dd-98b93b752a0a"
/>
## Solution
Hide it when empty
## Review instructions
- Publish an oauth app with only the _Database Read_ permission
- Use the oauth example to authorize it
- Update the published app to add the _Database Write_ permission
- Use the oauth example to authorize it again
You shouldn't see an _Already granted_ button