GH-3652 Add forgot password on sign-in page (#3789)

* Remove auth guard from password reset email endpoint

* Add arg for GQL mutation and update its usage

* Add forgot password button on sign-in page

* Generate automated graphql queries

* Move utils to dedicated hook

* Remove useless hook function

* Split simple hook methods

* Split workspace hook

* Split signInWithGoogle hook

* Split useSignInUpForm

* Fix error in logs

* Add Link Button UI Component

* Add storybook doc

---------

Co-authored-by: martmull <martmull@hotmail.fr>
This commit is contained in:
Deepak Kumar
2024-02-09 22:07:44 +05:30
committed by GitHub
parent 917fc5bd4d
commit 3cbf958a1c
16 changed files with 399 additions and 116 deletions

View File

@ -24,6 +24,11 @@ export type Scalars = {
Upload: { input: any; output: any; }
};
export type ApiKeyToken = {
__typename?: 'ApiKeyToken';
token: Scalars['String']['output'];
};
export type AuthProviders = {
__typename?: 'AuthProviders';
google: Scalars['Boolean']['output'];
@ -43,6 +48,11 @@ export type AuthTokenPair = {
refreshToken: AuthToken;
};
export type AuthTokens = {
__typename?: 'AuthTokens';
tokens: AuthTokenPair;
};
export type Billing = {
__typename?: 'Billing';
billingUrl: Scalars['String']['output'];
@ -136,6 +146,12 @@ export type DeleteOneRelationInput = {
id: Scalars['ID']['input'];
};
export type EmailPasswordResetLink = {
__typename?: 'EmailPasswordResetLink';
/** Boolean that confirms query was dispatched */
success: Scalars['Boolean']['output'];
};
export type FieldConnection = {
__typename?: 'FieldConnection';
/** Array of edges. */
@ -214,8 +230,20 @@ export type IdFilterComparison = {
notLike?: InputMaybe<Scalars['ID']['input']>;
};
export type InvalidatePassword = {
__typename?: 'InvalidatePassword';
/** Boolean that confirms query was dispatched */
success: Scalars['Boolean']['output'];
};
export type LoginToken = {
__typename?: 'LoginToken';
loginToken: AuthToken;
};
export type Mutation = {
__typename?: 'Mutation';
challenge: LoginToken;
createOneField: Field;
createOneObject: Object;
createOneRelation: Relation;
@ -223,11 +251,25 @@ export type Mutation = {
deleteOneObject: Object;
deleteOneRelation: RelationDeleteResponse;
deleteUser: User;
emailPasswordResetLink: EmailPasswordResetLink;
generateApiKeyToken: ApiKeyToken;
generateTransientToken: TransientToken;
impersonate: Verify;
renewToken: AuthTokens;
signUp: LoginToken;
updateOneField: Field;
updateOneObject: Object;
updatePasswordViaResetToken: InvalidatePassword;
uploadFile: Scalars['String']['output'];
uploadImage: Scalars['String']['output'];
uploadProfilePicture: Scalars['String']['output'];
verify: Verify;
};
export type MutationChallengeArgs = {
email: Scalars['String']['input'];
password: Scalars['String']['input'];
};
@ -261,6 +303,34 @@ export type MutationDeleteOneRelationArgs = {
};
export type MutationEmailPasswordResetLinkArgs = {
email: Scalars['String']['input'];
};
export type MutationGenerateApiKeyTokenArgs = {
apiKeyId: Scalars['String']['input'];
expiresAt: Scalars['String']['input'];
};
export type MutationImpersonateArgs = {
userId: Scalars['String']['input'];
};
export type MutationRenewTokenArgs = {
refreshToken: Scalars['String']['input'];
};
export type MutationSignUpArgs = {
email: Scalars['String']['input'];
password: Scalars['String']['input'];
workspaceInviteHash?: InputMaybe<Scalars['String']['input']>;
};
export type MutationUpdateOneFieldArgs = {
input: UpdateOneFieldMetadataInput;
};
@ -271,6 +341,12 @@ export type MutationUpdateOneObjectArgs = {
};
export type MutationUpdatePasswordViaResetTokenArgs = {
newPassword: Scalars['String']['input'];
passwordResetToken: Scalars['String']['input'];
};
export type MutationUploadFileArgs = {
file: Scalars['Upload']['input'];
fileFolder?: InputMaybe<FileFolder>;
@ -287,6 +363,11 @@ export type MutationUploadProfilePictureArgs = {
file: Scalars['Upload']['input'];
};
export type MutationVerifyArgs = {
loginToken: Scalars['String']['input'];
};
export type ObjectConnection = {
__typename?: 'ObjectConnection';
/** Array of edges. */
@ -321,13 +402,27 @@ export type PageInfo = {
export type Query = {
__typename?: 'Query';
checkUserExists: UserExists;
checkWorkspaceInviteHashIsValid: WorkspaceInviteHashValid;
currentUser: User;
field: Field;
fields: FieldConnection;
findWorkspaceFromInviteHash: Workspace;
object: Object;
objects: ObjectConnection;
relation: Relation;
relations: RelationConnection;
validatePasswordResetToken: ValidatePasswordResetToken;
};
export type QueryCheckUserExistsArgs = {
email: Scalars['String']['input'];
};
export type QueryCheckWorkspaceInviteHashIsValidArgs = {
inviteHash: Scalars['String']['input'];
};
@ -342,6 +437,11 @@ export type QueryFieldsArgs = {
};
export type QueryFindWorkspaceFromInviteHashArgs = {
inviteHash: Scalars['String']['input'];
};
export type QueryObjectArgs = {
id: Scalars['ID']['input'];
};
@ -362,6 +462,11 @@ export type QueryRelationsArgs = {
paging?: CursorPaging;
};
export type QueryValidatePasswordResetTokenArgs = {
passwordResetToken: Scalars['String']['input'];
};
export type RefreshToken = {
__typename?: 'RefreshToken';
createdAt: Scalars['DateTime']['output'];
@ -424,6 +529,19 @@ export type Telemetry = {
enabled: Scalars['Boolean']['output'];
};
export type TimelineThread = {
__typename?: 'TimelineThread';
firstParticipant: TimelineThreadParticipant;
id: Scalars['ID']['output'];
lastMessageBody: Scalars['String']['output'];
lastMessageReceivedAt: Scalars['DateTime']['output'];
lastTwoParticipants: Array<TimelineThreadParticipant>;
numberOfMessagesInThread: Scalars['Float']['output'];
participantCount: Scalars['Float']['output'];
read: Scalars['Boolean']['output'];
subject: Scalars['String']['output'];
};
export type TimelineThreadParticipant = {
__typename?: 'TimelineThreadParticipant';
avatarUrl: Scalars['String']['output'];
@ -435,6 +553,11 @@ export type TimelineThreadParticipant = {
workspaceMemberId?: Maybe<Scalars['ID']['output']>;
};
export type TransientToken = {
__typename?: 'TransientToken';
transientToken: AuthToken;
};
export type UpdateFieldInput = {
defaultValue?: InputMaybe<Scalars['JSON']['input']>;
description?: InputMaybe<Scalars['String']['input']>;
@ -502,6 +625,23 @@ export type UserEdge = {
node: User;
};
export type UserExists = {
__typename?: 'UserExists';
exists: Scalars['Boolean']['output'];
};
export type ValidatePasswordResetToken = {
__typename?: 'ValidatePasswordResetToken';
email: Scalars['String']['output'];
id: Scalars['String']['output'];
};
export type Verify = {
__typename?: 'Verify';
tokens: AuthTokenPair;
user: User;
};
export type Workspace = {
__typename?: 'Workspace';
allowImpersonation: Scalars['Boolean']['output'];
@ -524,6 +664,11 @@ export type WorkspaceEdge = {
node: Workspace;
};
export type WorkspaceInviteHashValid = {
__typename?: 'WorkspaceInviteHashValid';
isValid: Scalars['Boolean']['output'];
};
export type WorkspaceMember = {
__typename?: 'WorkspaceMember';
avatarUrl?: Maybe<Scalars['String']['output']>;