From cf93fe1d26fdf7cf158dbee36133651cc5c050b3 Mon Sep 17 00:00:00 2001 From: terminaldweller Date: Sat, 27 Jan 2024 21:25:16 -0500 Subject: added basic http auth --- main.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main.go b/main.go index 987a005..4bb4889 100644 --- a/main.go +++ b/main.go @@ -54,11 +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 { return context.JSON(http.StatusUnauthorized, "unauthorized") -- cgit v1.2.3