Mercurial > gemma
comparison pkg/controllers/token.go @ 512:7474e9922ed5
Don't tell what the reason is when login fails for database reasons.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Fri, 24 Aug 2018 18:04:25 +0200 |
parents | 8a0737aa6ab6 |
children | d9dbb6139760 |
comparison
equal
deleted
inserted
replaced
511:b96b1b258cfa | 512:7474e9922ed5 |
---|---|
76 | 76 |
77 token, session, err := auth.GenerateSession( | 77 token, session, err := auth.GenerateSession( |
78 string(input.User), | 78 string(input.User), |
79 input.Password) | 79 input.Password) |
80 if err != nil { | 80 if err != nil { |
81 http.Error(rw, "error: "+err.Error(), http.StatusUnauthorized) | 81 http.Error(rw, http.StatusText(http.StatusUnauthorized), http.StatusUnauthorized) |
82 return | 82 return |
83 } | 83 } |
84 | 84 |
85 var result = struct { | 85 var result = struct { |
86 Token string `json:"token"` | 86 Token string `json:"token"` |