* Fetch user info from GitLab * Used during OAuth completion to get user details
(credential: GitCredentials)
| 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 |
nothing calls this directly
no test coverage detected