satellite/console: disable account deletion via API

Change-Id: Ia8e43284c90fb2b833eb601e2c8f701cb5a4d9c0
This commit is contained in:
Stefan Benten 2020-10-06 12:25:12 +02:00
parent 338ed90876
commit 9deea2ffe2

View File

@ -235,26 +235,14 @@ func (a *Auth) GetAccount(w http.ResponseWriter, r *http.Request) {
}
}
// DeleteAccount - authorizes user and deletes account by password.
// DeleteAccount authorizes user and deletes account by password.
func (a *Auth) DeleteAccount(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
var err error
defer mon.Task()(&ctx)(&err)
var deleteRequest struct {
Password string `json:"password"`
}
err = json.NewDecoder(r.Body).Decode(&deleteRequest)
if err != nil {
a.serveJSONError(w, err)
return
}
err = a.service.DeleteAccount(ctx, deleteRequest.Password)
if err != nil {
a.serveJSONError(w, err)
}
// We do not want to allow account deletion via API currently.
a.serveJSONError(w, ErrAuthAPI.New("not implemented"))
}
// ChangePassword auth user, changes users password for a new one.