Skip to content

Commit

Permalink
[fix] #34
Browse files Browse the repository at this point in the history
  • Loading branch information
yoneyan committed Mar 18, 2021
1 parent 8f688b2 commit 476ff72
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/api/core/support/ticket/v0/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func CreateAdmin(c *gin.Context) {
// Admin authentication
resultAdmin := auth.AdminAuthentication(c.Request.Header.Get("ACCESS_TOKEN"))
if resultAdmin.Err != nil {
c.JSON(http.StatusInternalServerError, common.Error{Error: resultAdmin.Err.Error()})
c.JSON(http.StatusUnauthorized, common.Error{Error: resultAdmin.Err.Error()})
return
}

Expand Down Expand Up @@ -81,7 +81,7 @@ func UpdateAdmin(c *gin.Context) {
// Admin authentication
resultAdmin := auth.AdminAuthentication(c.Request.Header.Get("ACCESS_TOKEN"))
if resultAdmin.Err != nil {
c.JSON(http.StatusInternalServerError, common.Error{Error: resultAdmin.Err.Error()})
c.JSON(http.StatusUnauthorized, common.Error{Error: resultAdmin.Err.Error()})
return
}

Expand Down Expand Up @@ -125,7 +125,7 @@ func GetAdmin(c *gin.Context) {
// Admin authentication
resultAdmin := auth.AdminAuthentication(c.Request.Header.Get("ACCESS_TOKEN"))
if resultAdmin.Err != nil {
c.JSON(http.StatusInternalServerError, common.Error{Error: resultAdmin.Err.Error()})
c.JSON(http.StatusUnauthorized, common.Error{Error: resultAdmin.Err.Error()})
return
}

Expand Down Expand Up @@ -186,7 +186,7 @@ func GetAdminWebSocket(c *gin.Context) {
// Admin authentication
resultAdmin := auth.AdminAuthentication(accessToken)
if resultAdmin.Err != nil {
c.JSON(http.StatusInternalServerError, common.Error{Error: resultAdmin.Err.Error()})
c.JSON(http.StatusUnauthorized, common.Error{Error: resultAdmin.Err.Error()})
return
}

Expand Down

0 comments on commit 476ff72

Please sign in to comment.