diff --git a/controllers/authController.go b/controllers/authController.go index 568d0ef..e2a4442 100644 --- a/controllers/authController.go +++ b/controllers/authController.go @@ -114,6 +114,10 @@ func Login(c *gin.Context) { }) } +func ValidateToken(c *gin.Context) { + c.AbortWithStatus(http.StatusAccepted) +} + func createToken(userId uuid.UUID) (string, error) { token := jwt.NewWithClaims(jwt.SigningMethodHS256, jwt.MapClaims{ "bearer": userId, diff --git a/main.go b/main.go index 7442b06..41b08c2 100644 --- a/main.go +++ b/main.go @@ -31,6 +31,7 @@ func main() { // Auth api.Api.POST("/signup", controllers.Signup) api.Api.POST("/login", controllers.Login) + api.Api.GET("/validate", middleware.RequireAuth, controllers.ValidateToken) // Users api.Api.GET("/users", controllers.GetUsers)