hapi-oauth
TypeScript icon, indicating that this package has built-in type declarations

0.9.0 • Public • Published

Hapi oauth

Usage

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.
        ]
    }
});

/hapi-oauth/

    Package Sidebar

    Install

    npm i hapi-oauth

    Weekly Downloads

    22

    Version

    0.9.0

    License

    MIT

    Unpacked Size

    59.5 kB

    Total Files

    51

    Last publish

    Collaborators

    • unwrittenfun