feat(backend.auth): lab2 change error
This commit is contained in:
@@ -42,7 +42,7 @@ func CurrentUser(c *gin.Context) *domain.User {
|
||||
func abortUnauthorized(c *gin.Context, msg string) {
|
||||
reqID := GetRequestID(c)
|
||||
body := dto.ErrorFromDomain(
|
||||
&domain.ForbiddenError{Reason: msg},
|
||||
&domain.UnauthorizedError{Reason: msg},
|
||||
reqID,
|
||||
)
|
||||
c.AbortWithStatusJSON(http.StatusUnauthorized, body)
|
||||
|
||||
Reference in New Issue
Block a user