Skip to content

Commit 05f5654

Browse files
committed
Fix password being passed to user create
1 parent 3f4ed4c commit 05f5654

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/components/authentication/authentication.service.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ export class AuthenticationService {
4848
return token;
4949
}
5050

51-
async register(input: RegisterInput, session?: Session): Promise<ID> {
51+
async register(
52+
{ password, ...input }: RegisterInput,
53+
session?: Session,
54+
): Promise<ID> {
5255
// ensure no other tokens are associated with this user
5356
if (session) {
5457
await this.logout(session.token);
@@ -67,7 +70,7 @@ export class AuthenticationService {
6770
throw e;
6871
}
6972

70-
const passwordHash = await this.crypto.hash(input.password);
73+
const passwordHash = await this.crypto.hash(password);
7174
await this.repo.savePasswordHashOnUser(userId, passwordHash);
7275

7376
return userId;

0 commit comments

Comments
 (0)