authllizer-cordova-dialog
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

Authllizer Cordova Dialog

Source Code Version MIT License Bundle Size TypeScript

Install

$ npm install --save authllizer-cordova-dialog
# and add cordova plugin
$ cordova plugin add cordova-plugin-inappbrowser
# and install peer dependencies 
$ npm install --save @authllizer/core

Use

import { Authllizer, IAuthllizerOptions } from '@authllizer/core';
import CordovaDialog, { ICordovaDialogOptions } from 'authllizer-cordova-dialog';

let authllizer: Authllizer = new Authllizer({
    dialog: CordovaDialog.extend({
        // ...
    } as ICordovaDialogOptions),
    // ...
} as IAuthllizerOptions);

Support both cordova and browser

import { Authllizer, IAuthllizerOptions, BrowserDialog } from '@authllizer/core';
import CordovaDialog, { isCordova } from 'authllizer-cordova-dialog';

let authllizer: Authllizer = new Authllizer({
    dialog: isCordova() ? CordovaDialog : BrowserDialog,
    // ...
} as IAuthllizerOptions);

You must set the provider 'redirectUri' to the address you set as redirect uri in the provider settings

import { Authllizer, OAuth1Provider, OAuth2Provider, IAuthllizerOptions } from '@authllizer/core';

let authllizer: Authllizer = new Authllizer({
    providers:{
        some1: OAuth1Provider.extend({
            redirectUri: '***',
            // ...
        }),
        some2: OAuth2Provider.extend({
            redirectUri: '***',
            // ...
        }),
        // ...
    }
    // ...
} as IAuthllizerOptions);

License

Copyright © 2017 Yisrael Eliav, Licensed under the MIT license.

Package Sidebar

Install

npm i authllizer-cordova-dialog

Weekly Downloads

1

Version

0.2.0

License

MIT

Unpacked Size

67.2 kB

Total Files

29

Last publish

Collaborators

  • yisraelx