MCPcopy
hub / github.com/appleboy/gin-jwt / registerRoute

Function registerRoute

_example/basic/server.go:68–79  ·  view source on GitHub ↗
(r *gin.Engine, handle *jwt.GinJWTMiddleware)

Source from the content-addressed store, hash-verified

66}
67
68func registerRoute(r *gin.Engine, handle *jwt.GinJWTMiddleware) {
69 // Public routes
70 r.POST("/login", handle.LoginHandler)
71 r.POST("/refresh", handle.RefreshHandler) // RFC 6749 compliant refresh endpoint
72
73 r.NoRoute(handle.MiddlewareFunc(), handleNoRoute())
74
75 // Protected routes
76 auth := r.Group("/auth", handle.MiddlewareFunc())
77 auth.GET("/hello", helloHandler)
78 auth.POST("/logout", handle.LogoutHandler) // Logout with refresh token revocation
79}
80
81func initParams() *jwt.GinJWTMiddleware {
82 return &jwt.GinJWTMiddleware{

Callers 1

mainFunction · 0.70

Calls 2

MiddlewareFuncMethod · 0.80
handleNoRouteFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…