Fixed comments for create new device where device not found while saving device_info
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"log"
|
||||
"net/http"
|
||||
|
||||
"gitlab.com/pactual1/backend/middlewares"
|
||||
|
||||
"gitlab.com/pactual1/backend/shared"
|
||||
@@ -11,7 +14,7 @@ import (
|
||||
type AuthController struct{}
|
||||
|
||||
|
||||
func (this AuthController)HandleLogin(c *gin.Context) {
|
||||
func (AuthController)HandleLogin(c *gin.Context) {
|
||||
userId:="123"
|
||||
username:="Beast"
|
||||
roles:= []string{shared.RoleAdmin, shared.RoleProUser}
|
||||
@@ -21,6 +24,8 @@ func (this AuthController)HandleLogin(c *gin.Context) {
|
||||
//issue token
|
||||
token, err := middlewares.GenerateToken([]byte(middlewares.SigningKey), userId,username, roles)
|
||||
if err != nil {
|
||||
log.Printf("Unable to generate token %v", err)
|
||||
c.JSON(http.StatusInternalServerError, err)
|
||||
|
||||
}
|
||||
c.JSON(200, token)
|
||||
|
||||
Reference in New Issue
Block a user