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

Method LoginUsingToken

dgraphapi/cluster.go:118–136  ·  view source on GitHub ↗
(ns uint64)

Source from the content-addressed store, hash-verified

116}
117
118func (hc *HTTPClient) LoginUsingToken(ns uint64) error {
119 q := `mutation login( $namespace: Int, $refreshToken:String) {
120 login(namespace: $namespace, refreshToken: $refreshToken) {
121 response {
122 accessJWT
123 refreshJWT
124 }
125 }
126 }`
127 params := GraphQLParams{
128 Query: q,
129 Variables: map[string]interface{}{
130 "namespace": ns,
131 "refreshToken": hc.RefreshToken,
132 },
133 }
134
135 return hc.doLogin(params, true)
136}
137
138func (hc *HTTPClient) LoginIntoNamespace(user, password string, ns uint64) error {
139 // This is useful for v20.11 which does not support multi-tenancy

Callers 3

refreshTokenMethod · 0.80
TestTokenExpiredMethod · 0.80
TestCurlAuthorizationMethod · 0.80

Calls 1

doLoginMethod · 0.95

Tested by 3

refreshTokenMethod · 0.64
TestTokenExpiredMethod · 0.64
TestCurlAuthorizationMethod · 0.64