From 50d3da98a502212409c5281b1d4d4e3fd02e6b9b Mon Sep 17 00:00:00 2001 From: debuggerx Date: Tue, 18 Jan 2022 15:20:52 +0800 Subject: [PATCH] feat: hash user password when sign up --- api/lib/src/models/user.dart | 2 +- app/lib/http/api.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/lib/src/models/user.dart b/api/lib/src/models/user.dart index 8aab835..96203ff 100644 --- a/api/lib/src/models/user.dart +++ b/api/lib/src/models/user.dart @@ -16,7 +16,7 @@ abstract class _User extends BaseModel { @SerializableField(isNullable: false) String? get email; - @Column(isNullable: false, length: 32) + @Column(isNullable: false, length: 64) @SerializableField(isNullable: true, exclude: true) String? get password; diff --git a/app/lib/http/api.dart b/app/lib/http/api.dart index 3a52e9b..274c862 100644 --- a/app/lib/http/api.dart +++ b/app/lib/http/api.dart @@ -132,7 +132,7 @@ class Api { LoginSuccessSerializer.fromMap, body: { UserFields.email: email, - UserFields.password: password, + UserFields.password: User(email: email, password: password).secret('dgm_password'), }, ignoreToken: true, );