import * as HapiOAuth from 'hapi-oauth';
// ...
class ApiOAuthHandler extends HapiOAuth.OAuthHandler {
public onLink(res: LinkSuccess, request: Request, reply: IReply): void {
// Do your stuff
}
}
server.register({
register: HapiOAuth,
options: {
handler: new ApiOAuthHandler(),
baseUrl: 'http://localhost:8080',
requestConfig: {
// Change request config values here, e.g. adding optional auth (for linking existing accounts for example)
auth: { mode: 'optional', strategy: 'jwt' }
},
providers: [
new HapiOAuth.MixerProvider(
'mixerClientId',
'mixerClientSecret',
['user:details:self' /* add more scopes here */]
),
// Rinse and repeat for other providers.
]
}
});
-
Notifications
You must be signed in to change notification settings - Fork 2
jamesbirtles/hapi-oauth
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Allow your users to login with a number of oauth providers
Topics
Resources
Stars
Watchers
Forks
Packages 0
No packages published