Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var crypto = require('./crypto');
var session = require('./session');
var getOS = require('./utils').getOS;
var version = require('./version').raw;
var generateProofKey = crypto.generateProofKey;
var generateState = crypto.generateState;
var closingDelayMs = 1000;
session.clean();
var telemetry = {
name: 'auth0-cordova',
version: version,
env: {
'auth0.js': auth0.version,
os: getOS()
}
};
/**
* Creates a new Cordova client to handle AuthN/AuthZ with OAuth and OS browser.
* @constructor
* @param {Object} options
* @param {String} options.domain your Auth0 domain
* @param {String} options.clientId your Auth0 client identifier obtained when creating the client in the Auth0 Dashboard
* @see {@link https://auth0.com/docs/api/authentication}
*/
function CordovaAuth(options) {
this.clientId = options.clientId;
this.domain = options.domain;
this.redirectUri = options.packageIdentifier + '://' + options.domain + '/cordova/' + options.packageIdentifier + '/callback';