@@ -4,22 +4,18 @@ import type { GithubEmail } from "./types.js";
44export default class AdminForthAdapterGithubOauth2 implements OAuth2Adapter {
55 private clientID : string ;
66 private clientSecret : string ;
7- private redirectUri : string ;
87
98 constructor ( options : {
109 clientID : string ;
1110 clientSecret : string ;
12- redirectUri : string ;
1311 } ) {
1412 this . clientID = options . clientID ;
1513 this . clientSecret = options . clientSecret ;
16- this . redirectUri = options . redirectUri ;
1714 }
1815
1916 getAuthUrl ( ) : string {
2017 const params = new URLSearchParams ( {
2118 client_id : this . clientID ,
22- redirect_uri : this . redirectUri ,
2319 scope : 'user:email read:user' ,
2420 allow_signup : 'true' ,
2521 provider : this . constructor . name
@@ -28,7 +24,7 @@ export default class AdminForthAdapterGithubOauth2 implements OAuth2Adapter {
2824 return url ;
2925 }
3026
31- async getTokenFromCode ( code : string ) : Promise < { email : string ; name ?: string ; picture ?: string } > {
27+ async getTokenFromCode ( code : string , redirect_uri : string ) : Promise < { email : string ; } > {
3228 console . log ( 'Getting token from code:' , code ) ;
3329
3430 // Exchange code for token
@@ -42,7 +38,7 @@ export default class AdminForthAdapterGithubOauth2 implements OAuth2Adapter {
4238 code,
4339 client_id : this . clientID ,
4440 client_secret : this . clientSecret ,
45- redirect_uri : this . redirectUri ,
41+ redirect_uri,
4642 } ) ,
4743 } ) ;
4844
0 commit comments