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) {
|
func abortUnauthorized(c *gin.Context, msg string) {
|
||||||
reqID := GetRequestID(c)
|
reqID := GetRequestID(c)
|
||||||
body := dto.ErrorFromDomain(
|
body := dto.ErrorFromDomain(
|
||||||
&domain.ForbiddenError{Reason: msg},
|
&domain.UnauthorizedError{Reason: msg},
|
||||||
reqID,
|
reqID,
|
||||||
)
|
)
|
||||||
c.AbortWithStatusJSON(http.StatusUnauthorized, body)
|
c.AbortWithStatusJSON(http.StatusUnauthorized, body)
|
||||||
|
|||||||
Reference in New Issue
Block a user