From 797e3c5b357b8ed3ef2e7dba95bdfcf332f6506b Mon Sep 17 00:00:00 2001 From: liuyi Date: Tue, 19 Mar 2024 10:53:40 +0800 Subject: [PATCH] fix(server): do not force sign in password length (#6188) hotfix --- packages/backend/server/src/core/auth/controller.ts | 1 - packages/backend/server/src/core/auth/resolver.ts | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/backend/server/src/core/auth/controller.ts b/packages/backend/server/src/core/auth/controller.ts index e2ffed2525..47615005c8 100644 --- a/packages/backend/server/src/core/auth/controller.ts +++ b/packages/backend/server/src/core/auth/controller.ts @@ -58,7 +58,6 @@ export class AuthController { } if (credential.password) { - validators.assertValidPassword(credential.password); const user = await this.auth.signIn( credential.email, credential.password diff --git a/packages/backend/server/src/core/auth/resolver.ts b/packages/backend/server/src/core/auth/resolver.ts index edd2d2168d..58969d0b7b 100644 --- a/packages/backend/server/src/core/auth/resolver.ts +++ b/packages/backend/server/src/core/auth/resolver.ts @@ -132,7 +132,7 @@ export class AuthResolver { @Args('email') email: string, @Args('password') password: string ) { - validators.assertValidCredential({ email, password }); + validators.assertValidEmail(email); const user = await this.auth.signIn(email, password); await this.auth.setCookie(ctx.req, ctx.res, user); ctx.req.user = user;