feat: onboarding & profile edition (#507)

* feat: wip onboarding

* fix: generate graphql front

* wip: onboarding

* feat: login/register and edit profile

* fix: unused import

* fix: test

* Use DEBUG_MODE instead of STAGE and mute typescript depth exceed errors

* Fix seeds

* Fix onboarding when coming from google

* Fix

* Fix lint

* Fix ci

* Fix tests

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
Jérémy M
2023-07-07 02:05:15 +02:00
committed by GitHub
parent 0b7a023f3d
commit 1144bd13ed
141 changed files with 2660 additions and 962 deletions

View File

@ -1,5 +1,12 @@
import { ArgsType, Field } from '@nestjs/graphql';
import { IsEmail, IsNotEmpty, IsString } from 'class-validator';
import {
IsEmail,
IsNotEmpty,
IsString,
Matches,
MinLength,
} from 'class-validator';
import { PASSWORD_REGEX } from '../auth.util';
@ArgsType()
export class ChallengeInput {
@ -11,5 +18,7 @@ export class ChallengeInput {
@Field(() => String)
@IsNotEmpty()
@IsString()
@MinLength(8)
@Matches(PASSWORD_REGEX, { message: 'password too weak' })
password: string;
}

View File

@ -1,43 +0,0 @@
import {
IsEmail,
IsNotEmpty,
IsOptional,
IsString,
Matches,
MinLength,
} from 'class-validator';
import { PASSWORD_REGEX } from '../auth.util';
import { ArgsType, Field } from '@nestjs/graphql';
@ArgsType()
export class RegisterInput {
@Field(() => String)
@IsNotEmpty()
@IsEmail()
email: string;
@Field(() => String)
@IsNotEmpty()
@IsString()
@MinLength(8)
@Matches(PASSWORD_REGEX, { message: 'password too weak' })
password: string;
@Field(() => String, {
deprecationReason: 'Deprecated, please use firstName and lastName instead',
nullable: true,
})
@IsOptional()
@IsString()
displayName?: string;
@Field(() => String)
@IsNotEmpty()
@IsString()
firstName: string;
@Field(() => String)
@IsNotEmpty()
@IsString()
lastName: string;
}

View File

@ -31,4 +31,4 @@ export class ClientConfig {
@Field(() => Boolean)
prefill_login_with_seed: boolean;
}
}