From 9dcaa1ad39b1eaa8c3c82292695335c57bcce1e4 Mon Sep 17 00:00:00 2001 From: Lilleman Date: Fri, 22 Apr 2022 11:09:40 +0200 Subject: [PATCH] Added some more logging and documented deploy procedures --- README.md | 4 ++++ src/handlers/post.go | 2 ++ 2 files changed, 6 insertions(+) diff --git a/README.md b/README.md index 5276827..107c098 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,10 @@ The account field "role" is a bit special, in that if it contains "admin" as one Run integration tests (Requires migrated database and started API): `docker-compose run --rm tests` +## Deploy a new version + +Everytime a push is done, tests are ran on [Drone](https://drone.larvit.se/pwrpln/auth-api). To deploy a new version to [Dockerhub](https://hub.docker.com/repository/docker/lilleman/auth-api), create a new tag (USE SEMVER!!!). + ## Some useful cURLs Obtain an admin GWT: `curl -d '"api-key-goes-here"' -H "Content-Type: application/json" -i http://localhost:4000/auth/api-key` diff --git a/src/handlers/post.go b/src/handlers/post.go index 4b4d0f5..b550bbb 100644 --- a/src/handlers/post.go +++ b/src/handlers/post.go @@ -143,6 +143,8 @@ func (h Handlers) AccountAuthPassword(c *fiber.Ctx) error { if err != nil { if err.Error() == "no rows in result set" { return c.Status(403).JSON([]ResJSONError{{Error: "Invalid name or password"}}) + } else { + h.Log.Error("unknown error when resolving account", "err", err.Error()) } return c.Status(500).JSON([]ResJSONError{{Error: err.Error()}})