(params GraphQLParams, isAdmin bool)
| 190 | } |
| 191 | |
| 192 | func (hc *HTTPClient) doLogin(params GraphQLParams, isAdmin bool) error { |
| 193 | resp, err := hc.RunGraphqlQuery(params, isAdmin) |
| 194 | if err != nil { |
| 195 | return err |
| 196 | } |
| 197 | var r struct { |
| 198 | Login struct { |
| 199 | Response struct { |
| 200 | AccessJWT string |
| 201 | RefreshJwt string |
| 202 | } |
| 203 | } |
| 204 | } |
| 205 | if err := json.Unmarshal(resp, &r); err != nil { |
| 206 | return errors.Wrap(err, "error unmarshalling response into object") |
| 207 | } |
| 208 | if r.Login.Response.AccessJWT == "" { |
| 209 | return errors.Errorf("no access JWT found in the response") |
| 210 | } |
| 211 | |
| 212 | hc.HttpToken.AccessJwt = r.Login.Response.AccessJWT |
| 213 | hc.HttpToken.RefreshToken = r.Login.Response.RefreshJwt |
| 214 | return nil |
| 215 | } |
| 216 | |
| 217 | func (hc *HTTPClient) ResetPassword(userID, newPass string, nsID uint64) (string, error) { |
| 218 | const query = `mutation resetPassword($userID: String!, $newpass: String!, $namespaceId: Int!){ |
no test coverage detected