Skip to content

Commit

Permalink
Rename Unintuitive Function Names in Authentication Flow (#9706)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
samyakpiya and charlesBochet authored Jan 24, 2025
1 parent 570b2e3 commit 55be726
Show file tree
Hide file tree
Showing 19 changed files with 296 additions and 255 deletions.
1 change: 1 addition & 0 deletions packages/twenty-front/codegen.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module.exports = {
'./src/modules/**/*.tsx',
'./src/modules/**/*.ts',
'!./src/**/*.test.tsx',
'!./src/**/*.stories.tsx',
'!./src/**/__mocks__/*.ts',
'!./src/modules/users/graphql/queries/getCurrentUserAndViews.ts',
],
Expand Down
37 changes: 23 additions & 14 deletions packages/twenty-front/src/generated-metadata/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ export enum FeatureFlagKey {
IsJsonFilterEnabled = 'IsJsonFilterEnabled',
IsLocalizationEnabled = 'IsLocalizationEnabled',
IsMicrosoftSyncEnabled = 'IsMicrosoftSyncEnabled',
IsNewRelationEnabled = 'IsNewRelationEnabled',
IsPostgreSQLIntegrationEnabled = 'IsPostgreSQLIntegrationEnabled',
IsStripeIntegrationEnabled = 'IsStripeIntegrationEnabled',
IsUniqueIndexesEnabled = 'IsUniqueIndexesEnabled',
Expand Down Expand Up @@ -629,7 +630,6 @@ export type Mutation = {
activateWorkflowVersion: Scalars['Boolean']['output'];
activateWorkspace: Workspace;
authorizeApp: AuthorizeApp;
challenge: LoginToken;
checkoutSession: BillingSessionOutput;
computeStepOutputSchema: Scalars['JSON']['output'];
createDraftFromWorkflowVersion: WorkflowVersion;
Expand Down Expand Up @@ -660,7 +660,9 @@ export type Mutation = {
executeOneServerlessFunction: ServerlessFunctionExecutionResult;
generateApiKeyToken: ApiKeyToken;
generateTransientToken: TransientToken;
getAuthTokensFromLoginToken: AuthTokens;
getAuthorizationUrl: GetAuthorizationUrlOutput;
getLoginTokenFromCredentials: LoginToken;
getLoginTokenFromEmailVerificationToken: LoginToken;
impersonate: ImpersonateOutput;
publishServerlessFunction: ServerlessFunction;
Expand Down Expand Up @@ -690,7 +692,6 @@ export type Mutation = {
uploadProfilePicture: Scalars['String']['output'];
uploadWorkspaceLogo: Scalars['String']['output'];
userLookupAdminPanel: UserLookup;
verify: AuthTokens;
};


Expand All @@ -711,13 +712,6 @@ export type MutationAuthorizeAppArgs = {
};


export type MutationChallengeArgs = {
captchaToken?: InputMaybe<Scalars['String']['input']>;
email: Scalars['String']['input'];
password: Scalars['String']['input'];
};


export type MutationCheckoutSessionArgs = {
plan?: BillingPlanKey;
recurringInterval: SubscriptionInterval;
Expand Down Expand Up @@ -847,11 +841,23 @@ export type MutationGenerateApiKeyTokenArgs = {
};


export type MutationGetAuthTokensFromLoginTokenArgs = {
loginToken: Scalars['String']['input'];
};


export type MutationGetAuthorizationUrlArgs = {
input: GetAuthorizationUrlInput;
};


export type MutationGetLoginTokenFromCredentialsArgs = {
captchaToken?: InputMaybe<Scalars['String']['input']>;
email: Scalars['String']['input'];
password: Scalars['String']['input'];
};


export type MutationGetLoginTokenFromEmailVerificationTokenArgs = {
captchaToken?: InputMaybe<Scalars['String']['input']>;
emailVerificationToken: Scalars['String']['input'];
Expand Down Expand Up @@ -999,11 +1005,6 @@ export type MutationUserLookupAdminPanelArgs = {
userIdentifier: Scalars['String']['input'];
};


export type MutationVerifyArgs = {
loginToken: Scalars['String']['input'];
};

export type ObjectConnection = {
__typename?: 'ObjectConnection';
/** Array of edges. */
Expand Down Expand Up @@ -1300,6 +1301,13 @@ export enum RelationMetadataType {
ONE_TO_ONE = 'ONE_TO_ONE'
}

/** Relation type */
export enum RelationType {
MANY_TO_ONE = 'MANY_TO_ONE',
ONE_TO_MANY = 'ONE_TO_MANY',
ONE_TO_ONE = 'ONE_TO_ONE'
}

export type RemoteServer = {
__typename?: 'RemoteServer';
createdAt: Scalars['DateTime']['output'];
Expand Down Expand Up @@ -1898,6 +1906,7 @@ export type Field = {
name: Scalars['String']['output'];
object?: Maybe<Object>;
options?: Maybe<Scalars['JSON']['output']>;
relation?: Maybe<Relation>;
relationDefinition?: Maybe<RelationDefinition>;
settings?: Maybe<Scalars['JSON']['output']>;
toRelationMetadata?: Maybe<Relation>;
Expand Down
Loading

0 comments on commit 55be726

Please sign in to comment.