Minor fixes
This commit is contained in:
parent
737d5fb101
commit
72b5bdde4f
@ -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()
|
||||||
}
|
}
|
||||||
|
@ -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 {
|
||||||
|
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user