feat: auth middleware + /me endpoint
This commit is contained in:
parent
b28b719b51
commit
0b20a0d027
3 changed files with 40 additions and 5 deletions
|
@ -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)
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue