v1.1
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user