@@ -107,6 +107,9 @@ class StarletteAdapter(BaseAdapter, Starlette):
107
107
An optional :class:`str` passed to use as the EventSub secret. It is recommended you pass this parameter when using
108
108
an adapter for EventSub, as it will reset upon restarting otherwise. You can generate token safe secrets with the
109
109
:mod:`secrets` module.
110
+ oauth_path: str | None
111
+ An optional :class:`str` passed to use as the path for the OAuth route. Defaults to ``/oauth``.
112
+ E.g. ``http://localhost:4343/oauth`` or ``https://mydomain.org/oauth``.
110
113
redirect_path: str | None
111
114
An optional :class:`str` passed to use as the path for the Oauth Redirect callback. Defaults to ``/oauth/callback``.
112
115
E.g. ``http://localhost:4343/oauth/callback`` or ``https://mydomain.org/oauth/callback``.
@@ -160,6 +163,7 @@ def __init__(
160
163
domain : str | None = None ,
161
164
eventsub_path : str | None = None ,
162
165
eventsub_secret : str | None = None ,
166
+ oauth_path : str | None = None ,
163
167
redirect_path : str | None = None ,
164
168
ssl_keyfile : str | PathLike [str ] | None = None ,
165
169
ssl_keyfile_password : str | None = None ,
@@ -188,16 +192,19 @@ def __init__(
188
192
path : str = eventsub_path .removeprefix ("/" ).removesuffix ("/" ) if eventsub_path else "callback"
189
193
self ._eventsub_path : str = f"/{ path } "
190
194
191
- opath : str = redirect_path .removeprefix ("/" ).removesuffix ("/" ) if redirect_path else "oauth/callback"
192
- self ._redirect_path : str = f"/{ opath } "
195
+ rpath : str = redirect_path .removeprefix ("/" ).removesuffix ("/" ) if redirect_path else "oauth/callback"
196
+ self ._redirect_path : str = f"/{ rpath } "
197
+
198
+ opath : str = oauth_path .removeprefix ("/" ).removesuffix ("/" ) if oauth_path else "oauth"
199
+ self ._oauth_path : str = f"/{ opath } "
193
200
194
201
self ._runner_task : asyncio .Task [None ] | None = None
195
202
self ._responded : deque [str ] = deque (maxlen = 5000 )
196
203
197
204
super ().__init__ (
198
205
routes = [
199
206
Route (self ._redirect_path , self .oauth_callback , methods = ["GET" ]),
200
- Route ("/oauth" , self .oauth_redirect , methods = ["GET" ]),
207
+ Route (self . _oauth_path , self .oauth_redirect , methods = ["GET" ]),
201
208
Route (self ._eventsub_path , self .eventsub_callback , methods = ["POST" ]),
202
209
],
203
210
on_shutdown = [self .event_shutdown ],
0 commit comments