testing out ko build system

This commit is contained in:
d34dscene
2025-02-12 15:30:08 +01:00
parent b37d14f51c
commit 13a4063c66
25 changed files with 262 additions and 179 deletions
+12 -3
View File
@@ -57,7 +57,10 @@ func Login(a *config.App) http.HandlerFunc {
}
w.Header().Set("Content-Type", "application/json")
json.NewEncoder(w).Encode(map[string]string{"token": token})
if err := json.NewEncoder(w).Encode(map[string]string{"token": token}); err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
}
}
@@ -93,7 +96,10 @@ func VerifyJWT(a *config.App) http.HandlerFunc {
}
w.Header().Set("Content-Type", "application/json")
json.NewEncoder(w).Encode(user)
if err := json.NewEncoder(w).Encode(user); err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
}
}
@@ -145,7 +151,10 @@ func VerifyOTP(a *config.App) http.HandlerFunc {
}
w.Header().Set("Content-Type", "application/json")
json.NewEncoder(w).Encode(map[string]string{"token": token})
if err := json.NewEncoder(w).Encode(map[string]string{"token": token}); err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
}
}