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:
@ -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;
|
||||
}
|
||||
|
||||
7
server/src/core/auth/dto/user-exists.entity.ts
Normal file
7
server/src/core/auth/dto/user-exists.entity.ts
Normal file
@ -0,0 +1,7 @@
|
||||
import { Field, ObjectType } from '@nestjs/graphql';
|
||||
|
||||
@ObjectType()
|
||||
export class UserExists {
|
||||
@Field(() => Boolean)
|
||||
exists: boolean;
|
||||
}
|
||||
10
server/src/core/auth/dto/user-exists.input.ts
Normal file
10
server/src/core/auth/dto/user-exists.input.ts
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user