From a3bef9367d3a965b09563800909b5bbf33689b2a Mon Sep 17 00:00:00 2001 From: uebian Date: Sat, 27 Mar 2021 00:54:44 +0800 Subject: [PATCH] Fix the leak of user's passwords --- example.api.server.toml | 2 +- server/model/user.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/example.api.server.toml b/example.api.server.toml index 67339f9..de41135 100644 --- a/example.api.server.toml +++ b/example.api.server.toml @@ -16,7 +16,7 @@ url_prefix = "/api/" session_duration = 7200000000000 [mysql] -dsn = dsn = "username:password@tcp(localhost:3306)/dbname?&collation=utf8mb4_unicode_ci" +dsn = "username:password@tcp(localhost:3306)/dbname?&collation=utf8mb4_unicode_ci&parseTime=true" [security] jwt_secret = "" diff --git a/server/model/user.go b/server/model/user.go index 056d590..911e9d3 100644 --- a/server/model/user.go +++ b/server/model/user.go @@ -25,7 +25,7 @@ type User struct { Username string `json:"username,omitempty" gorm:"Unique"` - Password string `json:"password,omitempty"` + Password string `json:"-"` } func GetUserByName(name string) (User, error) { -- Gitee