Skip to content

Commit fb34ba2

Browse files
committed
fix: update getTokenFromCode to return full user information
1 parent d2bcc2e commit fb34ba2

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export default class AdminForthAdapterGithubOauth2 implements OAuth2Adapter {
2424
return url;
2525
}
2626

27-
async getTokenFromCode(code: string, redirect_uri: string): Promise<{ email: string;}> {
27+
async getTokenFromCode(code: string, redirect_uri: string): Promise<{ email: string, fullName: string, profilePictureUrl?: string }> {
2828
console.log('Getting token from code:', code);
2929

3030
// Exchange code for token
@@ -79,6 +79,8 @@ export default class AdminForthAdapterGithubOauth2 implements OAuth2Adapter {
7979

8080
return {
8181
email: userData.email,
82+
profilePictureUrl: userData.avatar_url,
83+
fullName: userData.name
8284
};
8385
}
8486
getIcon(): string {

0 commit comments

Comments
 (0)