Minor fixes
This commit is contained in:
parent
737d5fb101
commit
72b5bdde4f
@ -30,12 +30,12 @@ func main() {
|
||||
panic("couldn't open static files")
|
||||
}
|
||||
|
||||
h := &http.Handler{
|
||||
handler := &http.Handler{
|
||||
Service: q,
|
||||
TokenVerifier: &jwt.TokenVerifier{},
|
||||
CredentialsVerifier: &bcrypt.Verifier{},
|
||||
StaticFS: netHttp.FS(static),
|
||||
}
|
||||
|
||||
h.Serve()
|
||||
handler.Serve()
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ func (h *Handler) loginPost(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
t, err := h.TokenVerifier.CreateToken(&user)
|
||||
token, err := h.TokenVerifier.CreateToken(&user)
|
||||
if err != nil {
|
||||
c.AbortWithError(http.StatusUnauthorized, err)
|
||||
}
|
||||
@ -85,7 +85,7 @@ func (h *Handler) loginPost(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
c.JSON(http.StatusOK, LoginResponse{t, user, budgets})
|
||||
c.JSON(http.StatusOK, LoginResponse{token, user, budgets})
|
||||
}
|
||||
|
||||
type LoginResponse struct {
|
||||
|
@ -72,6 +72,7 @@ func (n Numeric) Sub(o Numeric) Numeric {
|
||||
|
||||
panic("Cannot subtract with different exponents")
|
||||
}
|
||||
|
||||
func (n Numeric) Add(o Numeric) Numeric {
|
||||
left := n
|
||||
right := o
|
||||
|
Loading…
x
Reference in New Issue
Block a user