0.2.0 • Published 5 years ago
authllizer-electron-dialog v0.2.0
Authllizer Electron Dialog
Install
$ npm install --save authllizer-electron-dialog
# and install peer dependencies
$ npm install --save @authllizer/core
Use
import { Authllizer, IAuthllizerOptions } from '@authllizer/core';
import ElectronDialog, { IElectronDialogOptions } from 'authllizer-electron-dialog';
let authllizer: Authllizer = new Authllizer({
dialog: ElectronDialog.extend({
// ...
} as IElectronDialogOptions),
// ...
} as IAuthllizerOptions);
Support both electron and browser
import { Authllizer, IAuthllizerOptions, BrowserDialog } from '@authllizer/core';
import ElectronDialog, { isElectron } from 'authllizer-electron-dialog';
let authllizer: Authllizer = new Authllizer({
dialog: isElectron() ? ElectronDialog : 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.