feat: clear user session issuer#2999
Conversation
🦋 Changeset detectedLatest commit: bddc1ac The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1141a6f205
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if _, err := s.repo.WithTx(dbtx).UpdateToolsetUserSessionIssuer(ctx, repo.UpdateToolsetUserSessionIssuerParams{ | ||
| UserSessionIssuerID: uuid.NullUUID{UUID: uuid.Nil, Valid: false}, | ||
| Slug: string(payload.Slug), | ||
| ProjectID: *authCtx.ProjectID, | ||
| }); err != nil { |
There was a problem hiding this comment.
Skip write/audit when issuer is already absent
clearUserSessionIssuer is documented and tested as a no-op when no issuer is linked, but this implementation always executes UpdateToolsetUserSessionIssuer and later logs a toolset update event. When beforeView.UserSessionIssuerID is already nil, repeated calls still create a synthetic update (including audit noise and state churn) instead of behaving as a true no-op. Consider returning early before the update/audit path when the toolset is already clear.
Useful? React with 👍 / 👎.
🚀 Preview Environment (PR #2999)Preview URL: https://pr-2999.dev.getgram.ai
Gram Preview Bot |
simplesagar
left a comment
There was a problem hiding this comment.
NIT: ideally the admin capabilities are added via a toolbar rather on the core dashboard itself
Adds toolsets.clearUserSessionIssuer to unlink any user_session_issuer attached to a toolset (sets toolsets.user_session_issuer_id to NULL). The USI row itself is untouched. Calling it on a toolset that already has no USI is a no-op. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds a small destructive button next to the "Login Secured" badge on the MCP authentication tab, visible only to admins when a user_session_issuer is wired. Clicking it calls toolsets.clearUserSessionIssuer to unlink the USI from the toolset so the wiring can be re-done without dropping into the database. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1141a6f to
bddc1ac
Compare
Sometimes you set up a user session issuer and you change your mind (oft because you wish to take another crack)
This fixes that problem