MCPcopy Create free account
hub / github.com/Kong/insomnia / fetchUser

Method fetchUser

packages/insomnia/src/sync/git/providers/gitlab.ts:267–281  ·  view source on GitHub ↗

* Fetch user info from GitLab * Used during OAuth completion to get user details

(credential: GitCredentials)

Source from the content-addressed store, hash-verified

265 * Used during OAuth completion to get user details
266 */
267 async fetchUser(credential: GitCredentials): Promise<ProviderUser> {
268 if (!isGitCredentialsV2(credential) || credential.provider !== 'gitlab') {
269 throw new Error('Invalid credential type for GitLab provider');
270 }
271
272 const data = await this.fetchUserWithToken(credential.credentials?.token);
273
274 return {
275 id: String(data.id),
276 username: data.username,
277 name: data.name || data.username,
278 email: data.commit_email || data.email,
279 avatarUrl: data.avatar_url,
280 };
281 }
282
283 /**
284 * Fetch user info with token directly

Callers

nothing calls this directly

Calls 2

fetchUserWithTokenMethod · 0.95
isGitCredentialsV2Function · 0.85

Tested by

no test coverage detected