Skip to content

feat: add cross app auth method#577

Open
stacurry wants to merge 1 commit intomainfrom
add-cross-app-auth-method
Open

feat: add cross app auth method#577
stacurry wants to merge 1 commit intomainfrom
add-cross-app-auth-method

Conversation

@stacurry
Copy link
Contributor

@stacurry stacurry commented Mar 2, 2026

Description

Add cross_app_auth as a session auth_method

Documentation

Does this require changes to the WorkOS Docs? E.g. the API Reference or code snippets need updates.

[ ] Yes

If yes, link a related docs PR and add a docs maintainer as a reviewer. Their approval is required.

@stacurry stacurry requested a review from a team as a code owner March 2, 2026 15:48
@stacurry stacurry requested a review from nicknisi March 2, 2026 15:48
@stacurry stacurry changed the title add cross app auth method fix: add cross app auth method Mar 2, 2026
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 2, 2026

Greptile Summary

This PR adds "cross_app_auth" as a new supported value in the AuthMethodType Literal type, which is used by the Session model's auth_method field. The change is minimal, focused, and correctly placed in alphabetical order within the existing list of auth method literals.

  • The single-line addition to AuthMethodType correctly extends the type so that Session objects returned from the API with auth_method: "cross_app_auth" are now valid and will not cause Pydantic validation errors.
  • No other files in the repository (e.g., authentication_payload.py) appear to require a corresponding change, as they use str directly for auth method fields.
  • No test changes are included, though the existing test fixtures don't directly test AuthMethodType literal exhaustiveness, so the absence of test changes is acceptable here.

Confidence Score: 5/5

  • This PR is safe to merge — it is a one-line, additive type change with no risk of regression.
  • The change is a single Literal value addition to a type alias used only as an annotation. It is backwards-compatible, correctly ordered, and does not affect any runtime logic.
  • No files require special attention.

Important Files Changed

Filename Overview
src/workos/types/user_management/session.py Adds "cross_app_auth" as a new valid value in the AuthMethodType Literal type; change is minimal, correct, and alphabetically ordered within the existing list.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[API Response with auth_method] --> B{Value in AuthMethodType?}
    B -- cross_app_auth ✅ NEW --> C[Session model validates successfully]
    B -- external_auth --> C
    B -- impersonation --> C
    B -- magic_code --> C
    B -- migrated_session --> C
    B -- oauth --> C
    B -- passkey --> C
    B -- password --> C
    B -- sso --> C
    B -- unknown --> C
    B -- other value --> D[Pydantic validation error]
    C --> E[AuthenticateWithSessionCookieSuccessResponse]
Loading

Last reviewed commit: 799d538

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

@stacurry stacurry changed the title fix: add cross app auth method feat: add cross app auth method Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant