1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-24 15:49:44 +02:00

Provide better Keycloak aiuth failure msg

This commit is contained in:
Harvey Kandola 2018-10-23 16:57:40 +01:00
parent 8cc6bf3d40
commit 4b543733e7

View file

@ -262,6 +262,7 @@ func (h *Handler) Authenticate(w http.ResponseWriter, r *http.Request) {
// so we reject login request.
if len(u.Accounts) == 0 {
response.WriteUnauthorizedError(w)
err = fmt.Errorf("no user accounts found for %s", u.Email)
h.Runtime.Log.Error(method, err)
return
}
@ -271,6 +272,7 @@ func (h *Handler) Authenticate(w http.ResponseWriter, r *http.Request) {
if ac.OrgID == org.RefID {
if ac.Active == false {
response.WriteUnauthorizedError(w)
err = fmt.Errorf("no ACTIVE user account found for %s", u.Email)
h.Runtime.Log.Error(method, err)
return
}