docs: clarify ErrOIDCSubjectAlreadyLinked sentinel description in auth/index.md#201
Merged
veverkap merged 1 commit intoMay 3, 2026
Conversation
The sentinel table previously described ErrOIDCSubjectAlreadyLinked as a "benign no-op" without qualification. This was misleading because the sentinel is only suppressed in the best-effort login path (linkOIDCSubjectBestEffort); the interactive link callback (handleLinkCallback) treats any non-nil return from LinkOIDCSubject as a failure and redirects with oidc_link_error=Failed+to+link. store-interfaces.md already documents the correct implementation pattern (idempotent upsert returning nil). Update the sentinel table in auth/index.md to reflect the same nuance and cross-link to the store-interfaces doc for the full recommendation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the auth package documentation to correct the quick-reference description of the auth.ErrOIDCSubjectAlreadyLinked sentinel so it matches actual handler behavior and the implementation guidance already documented for stores.
Changes:
- Clarifies that
auth.ErrOIDCSubjectAlreadyLinkedis only suppressed in the best-effort login path (linkOIDCSubjectBestEffort). - Warns that the interactive link callback treats any non-
nilLinkOIDCSubjecterror (including this sentinel) as a failure redirect. - Adds a cross-link to the recommended
UserStore.LinkOIDCSubjectidempotent-upsert behavior instore-interfaces.md#userstore.
Show a summary per file
| File | Description |
|---|---|
| docs/auth/index.md | Updates the sentinel error table entry for ErrOIDCSubjectAlreadyLinked to reflect real handler behavior and link to the fuller store guidance. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 1/1 changed files
- Comments generated: 0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The sentinel error table in
docs/auth/index.mddescribedauth.ErrOIDCSubjectAlreadyLinkedas a "benign no-op" without qualification:This is misleading. The sentinel is only suppressed in the best-effort login path (
linkOIDCSubjectBestEffort). The interactive link callback (handleLinkCallback) treats any non-nil return fromLinkOIDCSubjectas a failure and redirects withoidc_link_error=Failed+to+link— including this sentinel.docs/auth/store-interfaces.mdalready documents the correct implementation pattern (idempotent upsert returningnil), but the quick-reference table inauth/index.mdcontradicted it.Change
Updated the
auth/index.mdsentinel table to:store-interfaces.md#userstoresection for the full implementation recommendationNo code changes
This is a documentation-only fix. No Go source files were modified.
Warning
The following domain was blocked by the firewall during workflow execution:
proxy.golang.orgTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.
Greptile Summary
This documentation-only PR corrects the quick-reference description of
auth.ErrOIDCSubjectAlreadyLinkedindocs/auth/index.md, which previously called it a "benign no-op" without qualification. The new description accurately notes that the sentinel is suppressed only in the best-effort login path and is treated as a failure by the interactive link callback, and cross-links to the authoritative guidance instore-interfaces.md#userstore. The update is consistent with the existing detail instore-interfaces.md.Confidence Score: 5/5
This PR is safe to merge — documentation-only change with no code modifications.
Single-line doc update to a sentinel error table; the new description is factually accurate and consistent with the authoritative
store-interfaces.mdreference. Cross-link anchor#userstorematches the target heading. No code, no tests, no config changed.No files require special attention.
Important Files Changed
ErrOIDCSubjectAlreadyLinkedsentinel description to accurately distinguish best-effort vs. interactive-link-callback behavior and cross-link tostore-interfaces.md#userstore; content is consistent with the authoritative reference instore-interfaces.md.Sequence Diagram
sequenceDiagram participant Client participant linkOIDCSubjectBestEffort as Best-Effort Login Path participant handleLinkCallback as Interactive Link Callback participant Store as UserStore.LinkOIDCSubject Client->>linkOIDCSubjectBestEffort: OIDC login (subject already linked) linkOIDCSubjectBestEffort->>Store: LinkOIDCSubject(ctx, userID, subject) Store-->>linkOIDCSubjectBestEffort: ErrOIDCSubjectAlreadyLinked linkOIDCSubjectBestEffort-->>Client: Suppressed — login continues normally Client->>handleLinkCallback: Interactive OIDC link (subject already linked) handleLinkCallback->>Store: LinkOIDCSubject(ctx, userID, subject) Store-->>handleLinkCallback: ErrOIDCSubjectAlreadyLinked (any non-nil) handleLinkCallback-->>Client: Redirect with oidc_link_error=Failed+to+link Note over Store: Recommended: idempotent upsert returning nil avoids the callback-path failure entirelyReviews (1): Last reviewed commit: "docs: clarify ErrOIDCSubjectAlreadyLinke..." | Re-trigger Greptile