This commit is contained in:
daru
2022-04-15 01:38:32 +02:00
parent 19f860f418
commit 7307b3c808

View File

@@ -186,13 +186,13 @@ func WatchPost(ctx *fasthttp.RequestCtx) {
return return
} }
username := fmt.Sprintf("%s", ctx.UserValue("user")) username := fmt.Sprintf("%s", ctx.UserValue("user"))
if !authenticate(username, string(auth)) { if !GheddoAuth(username, string(auth)) {
ctx.SetStatusCode(fasthttp.StatusUnauthorized) ctx.SetStatusCode(fasthttp.StatusUnauthorized)
return return
} }
} }
func authenticate(username, auth string) bool { func GheddoAuth(username, auth string) bool {
user, err := ReadUser(username) user, err := ReadUser(username)
if err != nil { if err != nil {
return false return false