Skip to content

Track OAuth scopes and prompt re-auth when permissions change#17

Merged
emilam merged 1 commit into
mainfrom
emilam/log-fb-pages-response
Mar 9, 2026
Merged

Track OAuth scopes and prompt re-auth when permissions change#17
emilam merged 1 commit into
mainfrom
emilam/log-fb-pages-response

Conversation

@emilam

@emilam emilam commented Mar 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

Track which OAuth scopes users have granted to detect when new permissions are required after platform updates. Automatically display re-auth warnings on the account page when required scopes are missing.

Changes

  • Add granted_scopes column to track authorized permissions on Instagram and Facebook connections
  • Fetch and store granted scopes during OAuth callbacks via /me/permissions API
  • Check for missing required scopes and show reauth prompts on account page
  • Consolidate scope definitions into shared module to prevent drift between auth flows

Test plan

  • Migration creates new columns on connection tables
  • New OAuth flows capture and store granted scopes
  • Account page shows reauth warning when scopes are null or missing required values
  • Reauth button redirects to OAuth flow to add new scopes

🤖 Generated with Claude Code

Add granted_scopes tracking to Instagram and Facebook connections to detect when users need to re-authorize after new scopes are added. Fetch and store granted scopes during OAuth callbacks, display reauth warnings on account page when required scopes are missing, and consolidate scope definitions into a shared module to prevent drift.

- Add migration to create granted_scopes columns on connection tables
- Fetch granted scopes from /me/permissions API during OAuth flows
- Store scopes with connections to track what user authorized
- Add needsReauth() helper to check if new scopes are needed
- Display reauth warnings on account page with one-click fix
- Consolidate REQUIRED_*_SCOPES constants into shared module
- Improve error handling in OAuth callbacks for better debugging

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Mar 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
postimp Ready Ready Preview, Comment Mar 9, 2026 5:02am

@emilam emilam merged commit 4272b78 into main Mar 9, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant