frontend: don't use path to give team's ID, use a dedicated header
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
nemunaire 2021-02-05 16:57:23 +01:00
commit 0d792dcd8f
5 changed files with 53 additions and 60 deletions

View file

@ -15,11 +15,13 @@ func RegistrationHandler(w http.ResponseWriter, r *http.Request, sURL []string)
return
}
if len(sURL) < 1 || len(sURL[0]) == 0 {
http.Error(w, "{\"errmsg\":\"Arguments manquants.\"}", http.StatusBadRequest)
teamInitialName := "-"
if t := r.Header.Get("X-FIC-Team"); t != "" {
teamInitialName = t
} else {
http.Error(w, "{\"errmsg\":\"Votre jeton d'authentification semble invalide. Contactez l'équipe serveur.\"}", http.StatusInternalServerError)
return
}
teamInitialName := sURL[0]
// Check request type and size
if r.Method != "POST" {