Fixed naming

This commit is contained in:
Nedim
2023-09-14 08:10:33 +02:00
parent 1353404aed
commit dcf1652dd9
8 changed files with 1 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
package controllers
import (
"gitlab.com/pactual1/backend/middlewares"
"gitlab.com/pactual1/backend/shared"
"github.com/gin-gonic/gin"
)
type AuthController struct{}
func (this AuthController)HandleLogin(c *gin.Context) {
userId:="123"
username:="Beast"
roles:= []string{shared.RoleAdmin, shared.RoleProUser}
// do user auth here
//issue token
token, err := middlewares.GenerateToken([]byte(middlewares.SigningKey), userId,username, roles)
if err != nil {
}
c.JSON(200, token)
}