🏗️ microservice fabric splitting
This commit is contained in:
14
common/middleware/unauthorized_callback_middleware.go
Normal file
14
common/middleware/unauthorized_callback_middleware.go
Normal file
@@ -0,0 +1,14 @@
|
||||
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
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user