Files
schisandra-album-cloud-micr…/common/middleware/unauthorized_callback_middleware.go
2024-12-24 00:38:41 +08:00

15 lines
421 B
Go

package middleware
import (
"net/http"
"schisandra-album-cloud-microservices/common/errors"
"schisandra-album-cloud-microservices/common/xhttp"
)
func UnauthorizedCallbackMiddleware() func(w http.ResponseWriter, r *http.Request, err error) {
return func(w http.ResponseWriter, r *http.Request, err error) {
xhttp.JsonBaseResponseCtx(r.Context(), w, errors.New(http.StatusUnauthorized, err.Error()))
return
}
}