Rename Unintuitive Function Names in Authentication Flow #9623
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 toChallenge
on the backend.verify
: Corresponds toVerify
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:
Verify
→GetAuthTokensFromLoginToken
Challenge
→GetLoginTokenFromCredentials
- Frontend:
challenge
→getLoginTokenFromCredentials
verify
→getAuthTokensFromLoginToken
Metadata
Assignees
Type
Projects
Status
No status