This commit is contained in:
2026-02-27 14:08:10 +03:00
parent 3701af1fd7
commit b81df5866b
3 changed files with 22 additions and 25 deletions

View File

@@ -57,3 +57,10 @@ func ReadBody[T any](r *http.Request) (T, error) {
err := json.NewDecoder(r.Body).Decode(dst)
return *dst, err
}
func CheckToken(r *http.Request) bool {
auth := r.Header.Get("Authorization")
if auth != cfg.JWTSecret {
return false
}
return true
}