diff --git a/README.md b/README.md
index 5c1db4475..5c2251ca8 100644
--- a/README.md
+++ b/README.md
@@ -10,31 +10,33 @@
-- [Usage](#usage)
- - [For OAuth Apps](#for-oauth-apps)
- - [For GitHub Apps](#for-github-apps)
-- [Examples](#examples)
-- [`OAuthApp.defaults(options)`](#oauthappdefaultsoptions)
-- [Constructor options](#constructor-options)
-- [`app.on(eventName, eventHandler)`](#apponeventname-eventhandler)
-- [`app.octokit`](#appoctokit)
-- [`app.getUserOctokit(options)`](#appgetuseroctokitoptions)
-- [`app.getWebFlowAuthorizationUrl(options)`](#appgetwebflowauthorizationurloptions)
-- [`app.createToken(options)`](#appcreatetokenoptions)
- - [For OAuth Web flow](#for-oauth-web-flow)
- - [For OAuth Device flow](#for-oauth-device-flow)
-- [`app.checkToken(options)`](#appchecktokenoptions)
-- [`app.resetToken(options)`](#appresettokenoptions)
-- [`app.refreshToken(options)`](#apprefreshtokenoptions)
-- [`app.scopeToken(options)`](#appscopetokenoptions)
-- [`app.deleteToken(options)`](#appdeletetokenoptions)
-- [`app.deleteAuthorization(options)`](#appdeleteauthorizationoptions)
-- [Middlewares](#middlewares)
- - [`createNodeMiddleware(app, options)`](#createnodemiddlewareapp-options)
- - [`createWebWorkerHandler(app, options)`](#createwebworkerhandlerapp-options)
- - [`createAWSLambdaAPIGatewayV2Handler(app, options)`](#createawslambdaapigatewayv2handlerapp-options)
-- [Contributing](#contributing)
-- [License](#license)
+- [oauth-app.js](#oauth-appjs)
+ - [Usage](#usage)
+ - [For OAuth Apps](#for-oauth-apps)
+ - [For GitHub Apps](#for-github-apps)
+ - [Examples](#examples)
+ - [`OAuthApp.defaults(options)`](#oauthappdefaultsoptions)
+ - [Constructor options](#constructor-options)
+ - [`app.on(eventName, eventHandler)`](#apponeventname-eventhandler)
+ - [`app.octokit`](#appoctokit)
+ - [`app.getUserOctokit(options)`](#appgetuseroctokitoptions)
+ - [`app.getWebFlowAuthorizationUrl(options)`](#appgetwebflowauthorizationurloptions)
+ - [`app.createToken(options)`](#appcreatetokenoptions)
+ - [For OAuth Web flow](#for-oauth-web-flow)
+ - [For OAuth Device flow](#for-oauth-device-flow)
+ - [`app.checkToken(options)`](#appchecktokenoptions)
+ - [`app.resetToken(options)`](#appresettokenoptions)
+ - [`app.refreshToken(options)`](#apprefreshtokenoptions)
+ - [`app.scopeToken(options)`](#appscopetokenoptions)
+ - [`app.deleteToken(options)`](#appdeletetokenoptions)
+ - [`app.deleteAuthorization(options)`](#appdeleteauthorizationoptions)
+ - [Middlewares](#middlewares)
+ - [`createNodeMiddleware(app, options)`](#createnodemiddlewareapp-options)
+ - [`createWebWorkerHandler(app, options)`](#createwebworkerhandlerapp-options)
+ - [`createAWSLambdaAPIGatewayV2Handler(app, options)`](#createawslambdaapigatewayv2handlerapp-options)
+ - [Build Custom Middlewares](#build-custom-middlewares)
+ - [Contributing](#contributing)
+ - [License](#license)
@@ -188,6 +190,17 @@ const app = new MyOAuthApp({ clientId, clientSecret });
Sets the default value for app.getWebFlowAuthorizationUrl(options)
.
+
redirectUrl
+ string
+ defaultScopes
diff --git a/src/index.ts b/src/index.ts
index 353d4de5b..131e56f51 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -112,6 +112,7 @@ export class OAuthApp<
defaultScopes: options.defaultScopes || [],
allowSignup: options.allowSignup,
baseUrl: options.baseUrl,
+ redirectUrl: options.redirectUrl,
log: options.log,
Octokit,
octokit,
diff --git a/src/methods/get-web-flow-authorization-url.ts b/src/methods/get-web-flow-authorization-url.ts
index b103a420e..d0dd4a324 100644
--- a/src/methods/get-web-flow-authorization-url.ts
+++ b/src/methods/get-web-flow-authorization-url.ts
@@ -38,6 +38,7 @@ export function getWebFlowAuthorizationUrlWithState(
request: state.octokit.request,
...options,
allowSignup,
+ redirectUrl: options.redirectUrl || state.redirectUrl,
scopes: options.scopes || state.defaultScopes,
};
diff --git a/src/types.ts b/src/types.ts
index b31d3b275..8cf2e1855 100644
--- a/src/types.ts
+++ b/src/types.ts
@@ -36,6 +36,7 @@ type CommonOptions