well i guess i can POST releases now!

Signed-off-by: ari melody <ari@arimelody.me>
This commit is contained in:
ari melody 2024-08-01 03:54:15 +01:00
parent 10f5f51e76
commit 151b2d8fd9
13 changed files with 417 additions and 203 deletions

View file

@ -6,7 +6,7 @@ import (
"math/rand"
"net/http"
"os"
"strings"
// "strings"
"time"
"arimelody.me/arimelody.me/discord"
@ -59,6 +59,12 @@ func Handler() http.Handler {
func MustAuthorise(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
// TEMPORARY
ctx := context.WithValue(r.Context(), "role", "admin")
next.ServeHTTP(w, r.WithContext(ctx))
return
/*
auth := r.Header.Get("Authorization")
if strings.HasPrefix(auth, "Bearer ") {
auth = auth[7:]
@ -96,9 +102,9 @@ func MustAuthorise(next http.Handler) http.Handler {
return
}
ctx := context.WithValue(r.Context(), "token", session.Token)
ctx = context.WithValue(ctx, "role", "admin")
ctx := context.WithValue(r.Context(), "role", "admin")
next.ServeHTTP(w, r.WithContext(ctx))
*/
})
}