feat: auth middleware + /me endpoint

This commit is contained in:
hexlocation 2025-05-06 08:39:19 +02:00
parent b28b719b51
commit 0b20a0d027
3 changed files with 40 additions and 5 deletions

View file

@ -33,4 +33,9 @@ func RegisterAuthRoutes(cfg *types.StereoConfig, api *gin.RouterGroup) {
c.String(http.StatusOK, jwt)
})
api.GET("/auth/me", auth.JwtMiddleware(cfg.JWTSecret), func(c *gin.Context) {
claims, _ := c.Get("claims")
c.JSON(http.StatusOK, claims)
})
}