MCPcopy
hub / github.com/dgraph-io/dgraph / LoginIntoNamespaceV20

Method LoginIntoNamespaceV20

dgraphapi/cluster.go:168–190  ·  view source on GitHub ↗
(user, password string)

Source from the content-addressed store, hash-verified

166}
167
168func (hc *HTTPClient) LoginIntoNamespaceV20(user, password string) error {
169 q := `mutation login($userId: String, $password: String) {
170 login(userId: $userId, password: $password) {
171 response {
172 accessJWT
173 refreshJWT
174 }
175 }
176 }`
177 params := GraphQLParams{
178 Query: q,
179 Variables: map[string]interface{}{
180 "userId": user,
181 "password": password,
182 },
183 }
184
185 hc.HttpToken = &HttpToken{
186 UserId: user,
187 Password: password,
188 }
189 return hc.doLogin(params, true)
190}
191
192func (hc *HTTPClient) doLogin(params GraphQLParams, isAdmin bool) error {
193 resp, err := hc.RunGraphqlQuery(params, isAdmin)

Callers 1

LoginIntoNamespaceMethod · 0.95

Calls 1

doLoginMethod · 0.95

Tested by

no test coverage detected