Skip to content

Rename Unintuitive Function Names in Authentication Flow #9623

@samyakpiya

Description

References

This is a follow up to PR #9288. For more context, look at this conversation.

Scope & Context

The functions Verify, Challenge, and their corresponding frontend counterparts (challenge, verify) have unclear and non-intuitive names. This creates confusion for developers working with the authentication flow. Updating these names will improve readability and maintainability of the code.

Current behavior

Currently, the following functions are named in a way that does not clearly indicate their purpose:

  • Backend:
    • Verify: Exchanges a login token for authentication tokens.
    • Challenge: Generates a login token from user credentials.
  • Frontend:
    • challenge: Corresponds to Challenge on the backend.
    • verify: Corresponds to Verify on the backend.

These names can be confusing to developers, as they do not directly describe the functions' behavior.

Expected behavior

Rename the functions to better reflect their purpose. Proposed changes:

  • Backend:
    • VerifyGetAuthTokensFromLoginToken
    • ChallengeGetLoginTokenFromCredentials
  • Frontend:
    • challengegetLoginTokenFromCredentials
    • verifygetAuthTokensFromLoginToken

Metadata

Assignees

No one assigned

    Projects

    • Status

      No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions