diff options
author | terminaldweller <devi@terminaldweller.com> | 2024-01-28 03:50:08 +0000 |
---|---|---|
committer | terminaldweller <devi@terminaldweller.com> | 2024-01-28 03:50:08 +0000 |
commit | 74a3686b665320ef88fc1286a56ac4f8732179e3 (patch) | |
tree | a50f3b74551bec3acd45d280b0b36ccb6eb1d7d2 | |
parent | added basic http auth (diff) | |
download | sms-webhook-74a3686b665320ef88fc1286a56ac4f8732179e3.tar.gz sms-webhook-74a3686b665320ef88fc1286a56ac4f8732179e3.zip |
added basic http auth
-rw-r--r-- | main.go | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -54,15 +54,13 @@ func (hw handlerWrapper) postHandler(context echo.Context) error { if !ok { return context.JSON(http.StatusUnauthorized, "unauthorized") } - log.Println(user, pass) userRecord, err := hw.app.Dao().FindAuthRecordByUsername("users", user) if err != nil { return context.JSON(http.StatusUnauthorized, "unauthorized") } - log.Println(userRecord.Get("password")) - if userRecord.Get("password") != pass { + if !userRecord.ValidatePassword(pass) { return context.JSON(http.StatusUnauthorized, "unauthorized") } |