added some comments on the server side

This commit is contained in:
2024-03-18 10:19:39 +01:00
parent b45107c94b
commit 3f836d0fa6
11 changed files with 28 additions and 98 deletions

View File

@@ -39,6 +39,9 @@ func validateToken(tokenValue string) error {
return nil
}
// Authentication does NOT use http-Only cookies since there's not risk for XSS
// By exposing the server through https it's completely safe to use httpheaders
func Authenticated(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
token := r.Header.Get("X-Authentication")