Skip to content

feat: add missing auth methods#1509

Merged
stacurry merged 1 commit intomainfrom
add-missing-auth-methods
Mar 2, 2026
Merged

feat: add missing auth methods#1509
stacurry merged 1 commit intomainfrom
add-missing-auth-methods

Conversation

@stacurry
Copy link
Contributor

@stacurry stacurry commented Mar 2, 2026

Description

Some of the authentication methods that the API supports were not included in the types here; adding them

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:45
@stacurry stacurry requested a review from csrbarber March 2, 2026 15:45
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 2, 2026

Greptile Summary

This PR adds missing authentication method literals to two type union definitions in the user-management interfaces. It extends AuthenticationMethod in authentication-response.interface.ts with 7 new values (DiscordOAuth, IntuitOAuth, SlackOAuth, VercelMarketplaceOAuth, XeroOAuth, ExternalAuth, MigratedSession) and adds the missing 'cross_app_auth' literal to AuthMethod in session.interface.ts.

Key observations:

  • Changes are purely additive type-only additions with no logic changes, making them safe to merge.
  • AuthenticationMethod (PascalCase) and AuthMethod (snake_case) intentionally use different naming conventions to reflect the serialized vs. deserialized representations of API fields.
  • The newly added values are consistent: ExternalAuth/MigratedSession in AuthenticationMethod correspond to pre-existing external_auth/migrated_session in AuthMethod; similarly, cross_app_auth added to AuthMethod mirrors the pre-existing CrossAppAuth in AuthenticationMethod.
  • One pre-existing (not introduced by this PR) minor inconsistency: 'unknown' exists in AuthMethod but has no PascalCase counterpart in AuthenticationMethod.

Confidence Score: 5/5

  • This PR is safe to merge — it only adds missing string literals to TypeScript union types with no logic changes.
  • The changes are purely additive type-level additions. No runtime logic, no API calls, no security-sensitive code, and no breaking changes to existing consumers (new union members are fully backwards compatible). The additions are consistent with the existing conventions used in each file.
  • No files require special attention.

Important Files Changed

Filename Overview
src/user-management/interfaces/authentication-response.interface.ts Adds 7 new string literals to the AuthenticationMethod union type: DiscordOAuth, IntuitOAuth, SlackOAuth, VercelMarketplaceOAuth, XeroOAuth, ExternalAuth, and MigratedSession. No logic changes.
src/user-management/interfaces/session.interface.ts Adds the missing 'cross_app_auth' literal to the AuthMethod union type, aligning it with the pre-existing 'CrossAppAuth' value already present in AuthenticationMethod.

Class Diagram

%%{init: {'theme': 'neutral'}}%%
classDiagram
    class AuthenticationMethod {
        <<union type>>
        SSO
        Password
        Passkey
        AppleOAuth
        BitbucketOAuth
        DiscordOAuth ✨
        GitHubOAuth
        GitLabOAuth
        GoogleOAuth
        IntuitOAuth ✨
        LinkedInOAuth
        MicrosoftOAuth
        SalesforceOAuth
        SlackOAuth ✨
        VercelMarketplaceOAuth ✨
        VercelOAuth
        XeroOAuth ✨
        MagicAuth
        CrossAppAuth
        ExternalAuth ✨
        MigratedSession ✨
        Impersonation
    }

    class AuthMethod {
        <<union type>>
        cross_app_auth ✨
        external_auth
        impersonation
        magic_code
        migrated_session
        oauth
        passkey
        password
        sso
        unknown
    }

    class AuthenticationResponse {
        +User user
        +string organizationId?
        +string accessToken
        +string refreshToken
        +Impersonator impersonator?
        +AuthenticationMethod authenticationMethod?
        +string sealedSession?
        +OauthTokens oauthTokens?
    }

    class Session {
        +string id
        +string userId
        +AuthMethod authMethod
        +SessionStatus status
        +string expiresAt
    }

    AuthenticationResponse --> AuthenticationMethod
    Session --> AuthMethod
Loading

Last reviewed commit: 6d614c1

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.

2 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@stacurry stacurry changed the title add missing auth methods fix: add missing auth methods Mar 2, 2026
Copy link
Member

@nicknisi nicknisi left a comment

Choose a reason for hiding this comment

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

LGTM but to fix CI you'll need to rename the title of this PR to be prefixed with feat:. See this for more info on the labels and when to use them.

This is to automate the creation of release PRs.

@stacurry stacurry changed the title fix: add missing auth methods feat: add missing auth methods Mar 2, 2026
@stacurry stacurry merged commit 3a5ce41 into main Mar 2, 2026
9 of 10 checks passed
@stacurry stacurry deleted the add-missing-auth-methods branch March 2, 2026 15:56
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.

2 participants