Skip to content

Commit 7cc4cc4

Browse files
committed
fix: remove redirect_uri
1 parent 2cea8ad commit 7cc4cc4

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

index.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,18 @@ import type { GithubEmail } from "./types.js";
44
export 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

Comments
 (0)