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
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
f4dcaa23a3
commit
0d792dcd8f
5 changed files with 53 additions and 60 deletions
|
|
@ -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" {
|
||||
|
|
|
|||
Reference in a new issue