Move dashboard to api

This commit is contained in:
2022-01-21 14:20:12 +00:00
parent 929db00a47
commit ddab5998bc
3 changed files with 14 additions and 2 deletions

View File

@ -26,6 +26,18 @@ func (h *Handler) verifyLogin(c *gin.Context) (budgeteer.Token, error) {
return token, nil
}
func (h *Handler) verifyLoginWithForbidden(c *gin.Context) {
token, err := h.verifyLogin(c)
if err != nil {
//c.Header("WWW-Authenticate", "Bearer")
c.AbortWithStatus(http.StatusForbidden)
return
}
c.Set("token", token)
c.Next()
}
func (h *Handler) verifyLoginWithRedirect(c *gin.Context) {
token, err := h.verifyLogin(c)
if err != nil {