Feat/navigate to signup if email does not exist (#540)

* Add userExists route

* Fix demo mode for login

* Improve sign in/up flow

* Remove redundant password length constraint

* Fix test
This commit is contained in:
Emilien Chauvet
2023-07-08 15:02:39 -07:00
committed by GitHub
parent 36ace6cc03
commit 9cd5f7c057
10 changed files with 123 additions and 20 deletions

View File

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

View File

@ -0,0 +1,7 @@
import { Field, ObjectType } from '@nestjs/graphql';
@ObjectType()
export class UserExists {
@Field(() => Boolean)
exists: boolean;
}

View File

@ -0,0 +1,10 @@
import { ArgsType, Field } from '@nestjs/graphql';
import { IsNotEmpty, IsString } from 'class-validator';
@ArgsType()
export class CheckUserExistsInput {
@Field(() => String)
@IsString()
@IsNotEmpty()
email: string;
}