Skip to content

Commit 3050c24

Browse files
authored
Added Twitch Defaults (#107)
* Added Twitch Defaults * Update README.md * Update index.d.ts * Update index.test-d.ts * Update index.d.ts
1 parent 6f2ecf5 commit 3050c24

File tree

4 files changed

+10
-0
lines changed

4 files changed

+10
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ You can choose some default setup to assign to `auth` option.
6363
- `VKONTAKTE_CONFIGURATION`
6464
- `SPOTIFY_CONFIGURATION`
6565
- `DISCORD_CONFIGURATION`
66+
- `TWITCH_CONFIGURATION`
6667

6768
### Custom configuration
6869

index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ interface FastifyOAuth2 {
1010
MICROSOFT_CONFIGURATION: ProviderConfiguration;
1111
SPOTIFY_CONFIGURATION: ProviderConfiguration;
1212
VKONTAKTE_CONFIGURATION: ProviderConfiguration;
13+
TWITCH_CONFIGURATION: ProviderConfiguration;
1314
}
1415

1516
export const fastifyOauth2: FastifyPlugin<FastifyOAuth2Options> & FastifyOAuth2

index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,4 +230,11 @@ oauthPlugin.DISCORD_CONFIGURATION = {
230230
tokenPath: '/api/oauth2/token'
231231
}
232232

233+
oauthPlugin.TWITCH_CONFIGURATION = {
234+
authorizeHost: 'https://id.twitch.tv',
235+
authorizePath: '/oauth2/authorize',
236+
tokenHost: 'https://id.twitch.tv',
237+
tokenPath: '/oauth2/token'
238+
}
239+
233240
module.exports = oauthPlugin

index.test-d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ expectAssignable<ProviderConfiguration>(fastifyOauth2.LINKEDIN_CONFIGURATION);
5757
expectAssignable<ProviderConfiguration>(fastifyOauth2.MICROSOFT_CONFIGURATION);
5858
expectAssignable<ProviderConfiguration>(fastifyOauth2.SPOTIFY_CONFIGURATION);
5959
expectAssignable<ProviderConfiguration>(fastifyOauth2.VKONTAKTE_CONFIGURATION);
60+
expectAssignable<ProviderConfiguration>(fastifyOauth2.TWITCH_CONFIGURATION);
6061

6162
server.get('/testOauth/callback', async request => {
6263
expectType<OAuth2Namespace>(server.testOAuthName);

0 commit comments

Comments
 (0)