Chore: Remove result fields from login (#65136)

* remove result fields from login

* fix tests

* fix tests

* another shadowing
This commit is contained in:
Serge Zaitsev
2023-03-28 20:32:21 +02:00
committed by GitHub
parent 3b37135b5b
commit a38f230d37
22 changed files with 166 additions and 181 deletions
+2 -2
View File
@@ -38,8 +38,8 @@ func (hs *HTTPServer) SendResetPasswordEmail(c *contextmodel.ReqContext) respons
}
getAuthQuery := login.GetAuthInfoQuery{UserId: usr.ID}
if err := hs.authInfoService.GetAuthInfo(c.Req.Context(), &getAuthQuery); err == nil {
authModule := getAuthQuery.Result.AuthModule
if authInfo, err := hs.authInfoService.GetAuthInfo(c.Req.Context(), &getAuthQuery); err == nil {
authModule := authInfo.AuthModule
if authModule == login.LDAPAuthModule || authModule == login.AuthProxyAuthModule {
return response.Error(401, "Not allowed to reset password for LDAP or Auth Proxy user", nil)
}