mirror of
https://github.com/SecurityBrewery/catalyst.git
synced 2026-01-23 22:43:27 +01:00
refactor: remove pocketbase (#1138)
This commit is contained in:
16
app/auth/errorjson.go
Normal file
16
app/auth/errorjson.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package auth
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func unauthorizedJSON(w http.ResponseWriter, msg string) {
|
||||
errorJSON(w, http.StatusUnauthorized, msg)
|
||||
}
|
||||
|
||||
func errorJSON(w http.ResponseWriter, status int, msg string) {
|
||||
w.WriteHeader(status)
|
||||
w.Header().Set("Content-Type", "application/json; charset=UTF-8")
|
||||
_, _ = fmt.Fprintf(w, `{"status": %d, "error": %q, "message": %q}`, status, http.StatusText(status), msg)
|
||||
}
|
||||
Reference in New Issue
Block a user