add missing error handling

This commit is contained in:
Chris Cromer 2022-07-22 22:17:29 -04:00
parent e7559f0bf1
commit 0f14fa8faf
Signed by: cromer
GPG Key ID: FA91071797BEEEC2
1 changed files with 5 additions and 1 deletions

View File

@ -124,7 +124,11 @@ func Login(writer http.ResponseWriter, request *http.Request, params httprouter.
Token string `json:"token"`
}
tokenString, _ := utils.GenerateJWT("chris@cromer.cl", "cromer")
tokenString, err := utils.GenerateJWT("chris@cromer.cl", "cromer")
if err != nil {
utils.JSONErrorOutput(writer, http.StatusBadRequest, err.Error())
return
}
token := Token{Token: tokenString}