From 3dc0eabba03a3c5d467789666757061c9515d645 Mon Sep 17 00:00:00 2001 From: Patrick Alvin Alcala Date: Mon, 10 Nov 2025 13:39:20 +0800 Subject: [PATCH] Usage of middleware for token --- backend/main.go | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/backend/main.go b/backend/main.go index 09bdea5..a3641a0 100644 --- a/backend/main.go +++ b/backend/main.go @@ -4,15 +4,10 @@ import ( "database/sql" "log" "net/http" - - // "crypto/rand" - // "crypto/rsa" - // "crypto/x509" - // "encoding/base64" - // "encoding/pem" - // "errors" "os" + "ocbo-esign-backend/middleware" + "github.com/gin-contrib/cors" "github.com/gin-gonic/gin" _ "github.com/go-sql-driver/mysql" @@ -982,8 +977,7 @@ func connect() { } }) - // router.POST("/api/post-registration", middleware.tokenChecker, func(c *gin.Context) { - router.POST("/api/post-registration", func(c *gin.Context) { + router.POST("/api/post-registration", middleware.TokenChecker(), func(c *gin.Context) { type RegistrationData struct { Data int `json:"data"` Data2 string `json:"data2"`