email 唯一

This commit is contained in:
2023-05-16 04:55:18 +08:00
parent 983447bfc2
commit f899e84b48
2 changed files with 2 additions and 2 deletions

View File

@@ -63,7 +63,7 @@ func SessionsPost(w http.ResponseWriter, r *http.Request) {
// 使用Email獲取用戶
var user models.User
if err := configs.ORMDB().Where("email = ?", form.Email).First(&user).Error; err != nil {
w.WriteHeader(http.StatusUnauthorized)
w.WriteHeader(http.StatusNotFound)
w.Write([]byte("404 - User Not Found"))
return
}