Minor fixes
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
ci/woodpecker/push/woodpecker Pipeline failed
ci/woodpecker/pr/woodpecker Pipeline failed

This commit is contained in:
Jan Bader 2022-02-15 12:59:53 +00:00
parent 737d5fb101
commit 72b5bdde4f
3 changed files with 5 additions and 4 deletions

View File

@ -30,12 +30,12 @@ func main() {
panic("couldn't open static files") panic("couldn't open static files")
} }
h := &http.Handler{ handler := &http.Handler{
Service: q, Service: q,
TokenVerifier: &jwt.TokenVerifier{}, TokenVerifier: &jwt.TokenVerifier{},
CredentialsVerifier: &bcrypt.Verifier{}, CredentialsVerifier: &bcrypt.Verifier{},
StaticFS: netHttp.FS(static), StaticFS: netHttp.FS(static),
} }
h.Serve() handler.Serve()
} }

View File

@ -73,7 +73,7 @@ func (h *Handler) loginPost(c *gin.Context) {
return return
} }
t, err := h.TokenVerifier.CreateToken(&user) token, err := h.TokenVerifier.CreateToken(&user)
if err != nil { if err != nil {
c.AbortWithError(http.StatusUnauthorized, err) c.AbortWithError(http.StatusUnauthorized, err)
} }
@ -85,7 +85,7 @@ func (h *Handler) loginPost(c *gin.Context) {
return return
} }
c.JSON(http.StatusOK, LoginResponse{t, user, budgets}) c.JSON(http.StatusOK, LoginResponse{token, user, budgets})
} }
type LoginResponse struct { type LoginResponse struct {

View File

@ -72,6 +72,7 @@ func (n Numeric) Sub(o Numeric) Numeric {
panic("Cannot subtract with different exponents") panic("Cannot subtract with different exponents")
} }
func (n Numeric) Add(o Numeric) Numeric { func (n Numeric) Add(o Numeric) Numeric {
left := n left := n
right := o right := o