Skip to content

fix: use checkbox state as source of truth for OAuth scopes - #15

Merged
mattzcarey merged 3 commits into
mainfrom
fix/scope-selector-backend
Feb 17, 2026
Merged

fix: use checkbox state as source of truth for OAuth scopes#15
mattzcarey merged 3 commits into
mainfrom
fix/scope-selector-backend

Conversation

@mattzcarey

Copy link
Copy Markdown
Contributor

Summary

  • The backend treated template selection and individual scope checkboxes as mutually exclusive (if/else), so selecting a template then ticking extra scopes in the advanced section would silently drop the template scopes
  • Now the backend simply accepts whatever checkboxes the frontend sends — templates only preset checkboxes in the UI, the final checkbox state is the source of truth
  • Removes the silent default fallback: if no scopes are selected, an empty array is sent and Cloudflare's OAuth server handles validation

Test plan

  • Select "workers full" template, submit — should get all workers scopes
  • Select "workers full" template, expand advanced, tick "access write", submit — should get workers scopes + access write
  • Select "workers full" template, expand advanced, untick a scope, submit — should get workers scopes minus the unticked one
  • Submit with no scopes selected — should be rejected by Cloudflare OAuth server

The backend had an if/else that treated template selection and individual
scope checkboxes as mutually exclusive, causing selected scopes to be
silently dropped. Now the backend simply accepts whatever the frontend
checkboxes send without injecting defaults.
@mattzcarey
mattzcarey merged commit a2e19a2 into main Feb 17, 2026
1 check passed
@mattzcarey
mattzcarey deleted the fix/scope-selector-backend branch February 17, 2026 17:25
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