Socket
Socket
Sign inDemoInstall

auth0-js

Package Overview
Dependencies
Maintainers
1
Versions
262
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

auth0-js - npm Package Compare versions

Comparing version 1.3.4 to 1.3.5

2

bower.json
{
"//": "experimental bower support",
"name": "auth0-js",
"version": "1.3.4",
"version": "1.3.5",
"main": "lib/index.js",

@@ -6,0 +6,0 @@ "dependencies": {

@@ -230,2 +230,6 @@ ;(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){

if (!!options.popup) {
return this.loginWithPopup(options, callback);
};
var query = xtend(

@@ -240,2 +244,78 @@ this._getMode(),

Auth0.prototype.loginWithPopup = function(options, callback) {
var query = xtend(
this._getMode(),
options,
{ client_id: this._clientID, redirect_uri: this._callbackURL });
var popupUrl = 'https://' + this._domain + '/authorize?' + qs.stringify(query);
var popupOptions = xtend(
{ width: 500, height: 600 },
options.popupOptions);
var popup = window.open(popupUrl, null, popupSettings(popupOptions));
if (!popup) { return callback(new Error('Unable to open popup')); }
var popupReadyTimer = setInterval(popupReadyCheck, 50);
popup.focus();
function popupReadyCheck() {
if (!popup) {
// double check popup exists in case
// check is called before reload and
// after `popup = null` clear assignment
return clearInterval(popupReadyTimer);
}
if (!(popup.top || popup.window)) {
// popup was closed therefore stop check
clearInterval(popupReadyTimer);
popup = null;
return;
}
var hash = '';
try {
// Avoids error throwing when protocols or
// X-Origin restriction browser policies
// block access to `popup` window properties
if (/#access_token/.test(popup.location.href)) {
clearInterval(popupReadyTimer);
hash = popup.location.hash;
popup.close();
pupup = null;
}
if (/\?error/.test(popup.location.href)) {
clearInterval(popupReadyTimer);
hash = "#" + popup.location.search.slice(1);
popup.close();
popup = null;
};
} catch (err) { }
if (hash.length) { return onready(hash); }
}
function onready(hash) {
// Since `parseHash` gets executed
// at page load, it requires the page
// to be reloaded after hash changes
window.location.replace(hash);
window.location.reload();
}
function popupSettings(options) {
// Stringify popup options object into
// `window.open` string options format
var settings = '';
for (var key in popupOptions) {
settings += key + '=' + popupOptions[key] + ',';
}
return settings.slice(0, -1);
}
}
Auth0.prototype.loginWithUsernamePassword = function (options, callback) {

@@ -1103,9 +1183,8 @@ var self = this;

},{}],11:[function(require,module,exports){
/*! version: 0.9.1 */
/*!
/*! version: 0.9.7
* Reqwest! A general purpose XHR connection manager
* (c) Dustin Diaz 2013
* license MIT (c) Dustin Diaz 2013
* https://github.com/ded/reqwest
* license MIT
*/
!function (name, context, definition) {

@@ -1119,3 +1198,3 @@ if (typeof module != 'undefined' && module.exports) module.exports = definition()

, doc = document
, twoHundo = /^20\d$/
, twoHundo = /^(20\d|1223)$/
, byTag = 'getElementsByTagName'

@@ -1140,11 +1219,11 @@ , readyState = 'readyState'

, defaultHeaders = {
contentType: 'application/x-www-form-urlencoded'
, requestedWith: xmlHttpRequest
, accept: {
'contentType': 'application/x-www-form-urlencoded'
, 'requestedWith': xmlHttpRequest
, 'accept': {
'*': 'text/javascript, text/html, application/xml, text/xml, */*'
, xml: 'application/xml, text/xml'
, html: 'text/html'
, text: 'text/plain'
, json: 'application/json, text/javascript'
, js: 'application/javascript, text/javascript'
, 'xml': 'application/xml, text/xml'
, 'html': 'text/html'
, 'text': 'text/plain'
, 'json': 'application/json, text/javascript'
, 'js': 'application/javascript, text/javascript'
}

@@ -1155,3 +1234,3 @@ }

// is it x-domain
if (o.crossOrigin === true) {
if (o['crossOrigin'] === true) {
var xhr = win[xmlHttpRequest] ? new XMLHttpRequest() : null

@@ -1193,12 +1272,12 @@ if (xhr && 'withCredentials' in xhr) {

function setHeaders(http, o) {
var headers = o.headers || {}
var headers = o['headers'] || {}
, h
headers.Accept = headers.Accept
|| defaultHeaders.accept[o.type]
|| defaultHeaders.accept['*']
headers['Accept'] = headers['Accept']
|| defaultHeaders['accept'][o['type']]
|| defaultHeaders['accept']['*']
// breaks cross-origin requests with legacy browsers
if (!o.crossOrigin && !headers[requestedWith]) headers[requestedWith] = defaultHeaders.requestedWith
if (!headers[contentType]) headers[contentType] = o.contentType || defaultHeaders.contentType
if (!o['crossOrigin'] && !headers[requestedWith]) headers[requestedWith] = defaultHeaders['requestedWith']
if (!headers[contentType]) headers[contentType] = o['contentType'] || defaultHeaders['contentType']
for (h in headers)

@@ -1209,4 +1288,4 @@ headers.hasOwnProperty(h) && 'setRequestHeader' in http && http.setRequestHeader(h, headers[h])

function setCredentials(http, o) {
if (typeof o.withCredentials !== 'undefined' && typeof http.withCredentials !== 'undefined') {
http.withCredentials = !!o.withCredentials
if (typeof o['withCredentials'] !== 'undefined' && typeof http.withCredentials !== 'undefined') {
http.withCredentials = !!o['withCredentials']
}

@@ -1225,5 +1304,5 @@ }

var reqId = uniqid++
, cbkey = o.jsonpCallback || 'callback' // the 'callback' key
, cbval = o.jsonpCallbackName || reqwest.getcallbackPrefix(reqId)
// , cbval = o.jsonpCallbackName || ('reqwest_' + reqId) // the 'callback' value
, cbkey = o['jsonpCallback'] || 'callback' // the 'callback' key
, cbval = o['jsonpCallbackName'] || reqwest.getcallbackPrefix(reqId)
// , cbval = o['jsonpCallbackName'] || ('reqwest_' + reqId) // the 'callback' value
, cbreg = new RegExp('((^|\\?|&)' + cbkey + ')=([^&]+)')

@@ -1290,8 +1369,8 @@ , match = url.match(cbreg)

var o = this.o
, method = (o.method || 'GET').toUpperCase()
, url = typeof o === 'string' ? o : o.url
// convert non-string objects to query-string form unless o.processData is false
, data = (o.processData !== false && o.data && typeof o.data !== 'string')
? reqwest.toQueryString(o.data)
: (o.data || null)
, method = (o['method'] || 'GET').toUpperCase()
, url = typeof o === 'string' ? o : o['url']
// convert non-string objects to query-string form unless o['processData'] is false
, data = (o['processData'] !== false && o['data'] && typeof o['data'] !== 'string')
? reqwest.toQueryString(o['data'])
: (o['data'] || null)
, http

@@ -1302,3 +1381,3 @@ , sendWait = false

// query string to end of URL and not post data
if ((o.type == 'jsonp' || method == 'GET') && data) {
if ((o['type'] == 'jsonp' || method == 'GET') && data) {
url = urlappend(url, data)

@@ -1308,6 +1387,9 @@ data = null

if (o.type == 'jsonp') return handleJsonp(o, fn, err, url)
if (o['type'] == 'jsonp') return handleJsonp(o, fn, err, url)
http = xhr(o)
http.open(method, url, o.async === false ? false : true)
// get the xhr from the factory if passed
// if the factory returns null, fall-back to ours
http = (o.xhr && o.xhr(o)) || xhr(o)
http.open(method, url, o['async'] === false ? false : true)
setHeaders(http, o)

@@ -1325,3 +1407,3 @@ setCredentials(http, o)

}
o.before && o.before(http)
o['before'] && o['before'](http)
if (sendWait) {

@@ -1351,3 +1433,3 @@ setTimeout(function () {

this.url = typeof o == 'string' ? o : o.url
this.url = typeof o == 'string' ? o : o['url']
this.timeout = null

@@ -1369,27 +1451,27 @@

var self = this
, type = o.type || setType(this.url)
, type = o['type'] || setType(this.url)
fn = fn || function () {}
if (o.timeout) {
if (o['timeout']) {
this.timeout = setTimeout(function () {
self.abort()
}, o.timeout)
}, o['timeout'])
}
if (o.success) {
if (o['success']) {
this._successHandler = function () {
o.success.apply(o, arguments)
o['success'].apply(o, arguments)
}
}
if (o.error) {
if (o['error']) {
this._errorHandlers.push(function () {
o.error.apply(o, arguments)
o['error'].apply(o, arguments)
})
}
if (o.complete) {
if (o['complete']) {
this._completeHandlers.push(function () {
o.complete.apply(o, arguments)
o['complete'].apply(o, arguments)
})

@@ -1399,3 +1481,3 @@ }

function complete (resp) {
o.timeout && clearTimeout(self.timeout)
o['timeout'] && clearTimeout(self.timeout)
self.timeout = null

@@ -1541,4 +1623,4 @@ while (self._completeHandlers.length > 0) {

// 'specified' ref: http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-862529273
if (o && !o.disabled)
cb(n, normalize(o.attributes.value && o.attributes.value.specified ? o.value : o.text))
if (o && !o['disabled'])
cb(n, normalize(o['attributes']['value'] && o['attributes']['value']['specified'] ? o['value'] : o['text']))
}

@@ -1650,3 +1732,3 @@ , ch, ra, val, i

if (isArray(o)) {
for (i = 0; o && i < o.length; i++) add(o[i].name, o[i].value)
for (i = 0; o && i < o.length; i++) add(o[i]['name'], o[i]['value'])
} else {

@@ -1656,3 +1738,3 @@ // If traditional, encode the "old" way (the way 1.3.2 or older

for (prefix in o) {
buildParams(prefix, o[prefix], traditional, add)
if (o.hasOwnProperty(prefix)) buildParams(prefix, o[prefix], traditional, add)
}

@@ -1700,6 +1782,6 @@ }

if (o) {
o.type && (o.method = o.type) && delete o.type
o.dataType && (o.type = o.dataType)
o.jsonpCallback && (o.jsonpCallbackName = o.jsonpCallback) && delete o.jsonpCallback
o.jsonp && (o.jsonpCallback = o.jsonp)
o['type'] && (o['method'] = o['type']) && delete o['type']
o['dataType'] && (o['type'] = o['dataType'])
o['jsonpCallback'] && (o['jsonpCallbackName'] = o['jsonpCallback']) && delete o['jsonpCallback']
o['jsonp'] && (o['jsonpCallback'] = o['jsonp'])
}

@@ -1706,0 +1788,0 @@ return new Reqwest(o, fn)

@@ -166,2 +166,6 @@ var assert_required = require('./assert_required');

if (!!options.popup) {
return this.loginWithPopup(options, callback);
};
var query = xtend(

@@ -176,2 +180,78 @@ this._getMode(),

Auth0.prototype.loginWithPopup = function(options, callback) {
var query = xtend(
this._getMode(),
options,
{ client_id: this._clientID, redirect_uri: this._callbackURL });
var popupUrl = 'https://' + this._domain + '/authorize?' + qs.stringify(query);
var popupOptions = xtend(
{ width: 500, height: 600 },
options.popupOptions);
var popup = window.open(popupUrl, null, popupSettings(popupOptions));
if (!popup) { return callback(new Error('Unable to open popup')); }
var popupReadyTimer = setInterval(popupReadyCheck, 50);
popup.focus();
function popupReadyCheck() {
if (!popup) {
// double check popup exists in case
// check is called before reload and
// after `popup = null` clear assignment
return clearInterval(popupReadyTimer);
}
if (!(popup.top || popup.window)) {
// popup was closed therefore stop check
clearInterval(popupReadyTimer);
popup = null;
return;
}
var hash = '';
try {
// Avoids error throwing when protocols or
// X-Origin restriction browser policies
// block access to `popup` window properties
if (/#access_token/.test(popup.location.href)) {
clearInterval(popupReadyTimer);
hash = popup.location.hash;
popup.close();
pupup = null;
}
if (/\?error/.test(popup.location.href)) {
clearInterval(popupReadyTimer);
hash = "#" + popup.location.search.slice(1);
popup.close();
popup = null;
};
} catch (err) { }
if (hash.length) { return onready(hash); }
}
function onready(hash) {
// Since `parseHash` gets executed
// at page load, it requires the page
// to be reloaded after hash changes
window.location.replace(hash);
window.location.reload();
}
function popupSettings(options) {
// Stringify popup options object into
// `window.open` string options format
var settings = '';
for (var key in popupOptions) {
settings += key + '=' + popupOptions[key] + ',';
}
return settings.slice(0, -1);
}
}
Auth0.prototype.loginWithUsernamePassword = function (options, callback) {

@@ -178,0 +258,0 @@ var self = this;

{
"name": "auth0-js",
"version": "1.3.4",
"version": "1.3.5",
"description": "Auth0 headless browser sdk",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -74,2 +74,14 @@ [![Build Status](https://auth0-tc-hub.herokuapp.com/bt21/status.png)](https://auth0-tc-hub.herokuapp.com/bt21)

});
//trigger login popup with google
$('.login-google-popup').click(function () {
auth0.login({
connection: 'google-oauth2',
popup: true,
popupOptions: {
width: 450,
height: 800
}
});
});
~~~

@@ -76,0 +88,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc