Rename Unintuitive Function Names in Authentication Flow (#9706)

Resolves #9623

## Description

This PR renames the following functions to better reflect their purpose.

- Backend:
  - Verify → GetAuthTokensFromLoginToken
  - Challenge → GetLoginTokenFromCredentials

- Frontend:
  - challenge → getLoginTokenFromCredentials
  - verify → getAuthTokensFromLoginToken

## Testing
_Sign in works as expected:_


https://github.com/user-attachments/assets/7e8f73c7-2c7d-4cd2-9965-5ad9f5334cd3

_Sign up works as expected:_
  

https://github.com/user-attachments/assets/d1794ee4-8b59-4934-84df-d819eabd5224

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
Samyak Piya
2025-01-24 13:19:14 -05:00
committed by GitHub
parent 570b2e3530
commit 55be726105
19 changed files with 300 additions and 259 deletions

View File

@ -1,15 +0,0 @@
import { gql } from '@apollo/client';
export const CHALLENGE = gql`
mutation Challenge(
$email: String!
$password: String!
$captchaToken: String
) {
challenge(email: $email, password: $password, captchaToken: $captchaToken) {
loginToken {
...AuthTokenFragment
}
}
}
`;

View File

@ -0,0 +1,11 @@
import { gql } from '@apollo/client';
export const GET_AUTH_TOKENS_FROM_LOGIN_TOKEN = gql`
mutation GetAuthTokensFromLoginToken($loginToken: String!) {
getAuthTokensFromLoginToken(loginToken: $loginToken) {
tokens {
...AuthTokensFragment
}
}
}
`;

View File

@ -0,0 +1,19 @@
import { gql } from '@apollo/client';
export const GET_LOGIN_TOKEN_FROM_CREDENTIALS = gql`
mutation GetLoginTokenFromCredentials(
$email: String!
$password: String!
$captchaToken: String
) {
getLoginTokenFromCredentials(
email: $email
password: $password
captchaToken: $captchaToken
) {
loginToken {
...AuthTokenFragment
}
}
}
`;

View File

@ -1,11 +0,0 @@
import { gql } from '@apollo/client';
export const VERIFY = gql`
mutation Verify($loginToken: String!) {
verify(loginToken: $loginToken) {
tokens {
...AuthTokensFragment
}
}
}
`;