Skip to content

Commit e4c0e95

Browse files
Update endpoint and add API to get password reset challenge (#1431)
Co-authored-by: Steve Hobbs <[email protected]>
1 parent 3fc295a commit e4c0e95

14 files changed

+975
-341
lines changed

dist/auth0.js

Lines changed: 147 additions & 135 deletions
Large diffs are not rendered by default.

dist/auth0.min.esm.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/auth0.min.esm.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/auth0.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/auth0.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/cordova-auth0-plugin.js

Lines changed: 82 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* auth0-js v9.25.0
33
* Author: Auth0
4-
* Date: 2024-04-25
4+
* Date: 2024-04-29
55
* License: MIT
66
*/
77

@@ -504,46 +504,88 @@
504504
return shams();
505505
};
506506

507+
var test = {
508+
foo: {}
509+
};
510+
511+
var $Object = Object;
512+
513+
var hasProto = function hasProto() {
514+
return { __proto__: test }.foo === test.foo && !({ __proto__: null } instanceof $Object);
515+
};
516+
507517
/* eslint no-invalid-this: 1 */
508518

509519
var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
510-
var slice = Array.prototype.slice;
511520
var toStr = Object.prototype.toString;
521+
var max = Math.max;
512522
var funcType = '[object Function]';
513523

524+
var concatty = function concatty(a, b) {
525+
var arr = [];
526+
527+
for (var i = 0; i < a.length; i += 1) {
528+
arr[i] = a[i];
529+
}
530+
for (var j = 0; j < b.length; j += 1) {
531+
arr[j + a.length] = b[j];
532+
}
533+
534+
return arr;
535+
};
536+
537+
var slicy = function slicy(arrLike, offset) {
538+
var arr = [];
539+
for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {
540+
arr[j] = arrLike[i];
541+
}
542+
return arr;
543+
};
544+
545+
var joiny = function (arr, joiner) {
546+
var str = '';
547+
for (var i = 0; i < arr.length; i += 1) {
548+
str += arr[i];
549+
if (i + 1 < arr.length) {
550+
str += joiner;
551+
}
552+
}
553+
return str;
554+
};
555+
514556
var implementation = function bind(that) {
515557
var target = this;
516-
if (typeof target !== 'function' || toStr.call(target) !== funcType) {
558+
if (typeof target !== 'function' || toStr.apply(target) !== funcType) {
517559
throw new TypeError(ERROR_MESSAGE + target);
518560
}
519-
var args = slice.call(arguments, 1);
561+
var args = slicy(arguments, 1);
520562

521563
var bound;
522564
var binder = function () {
523565
if (this instanceof bound) {
524566
var result = target.apply(
525567
this,
526-
args.concat(slice.call(arguments))
568+
concatty(args, arguments)
527569
);
528570
if (Object(result) === result) {
529571
return result;
530572
}
531573
return this;
532-
} else {
533-
return target.apply(
534-
that,
535-
args.concat(slice.call(arguments))
536-
);
537574
}
575+
return target.apply(
576+
that,
577+
concatty(args, arguments)
578+
);
579+
538580
};
539581

540-
var boundLength = Math.max(0, target.length - args.length);
582+
var boundLength = max(0, target.length - args.length);
541583
var boundArgs = [];
542584
for (var i = 0; i < boundLength; i++) {
543-
boundArgs.push('$' + i);
585+
boundArgs[i] = '$' + i;
544586
}
545587

546-
bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
588+
bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);
547589

548590
if (target.prototype) {
549591
var Empty = function Empty() {};
@@ -602,18 +644,23 @@
602644
: throwTypeError;
603645

604646
var hasSymbols$1 = hasSymbols();
647+
var hasProto$1 = hasProto();
605648

606-
var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto
649+
var getProto = Object.getPrototypeOf || (
650+
hasProto$1
651+
? function (x) { return x.__proto__; } // eslint-disable-line no-proto
652+
: null
653+
);
607654

608655
var needsEval = {};
609656

610-
var TypedArray = typeof Uint8Array === 'undefined' ? undefined$1 : getProto(Uint8Array);
657+
var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined$1 : getProto(Uint8Array);
611658

612659
var INTRINSICS = {
613660
'%AggregateError%': typeof AggregateError === 'undefined' ? undefined$1 : AggregateError,
614661
'%Array%': Array,
615662
'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined$1 : ArrayBuffer,
616-
'%ArrayIteratorPrototype%': hasSymbols$1 ? getProto([][Symbol.iterator]()) : undefined$1,
663+
'%ArrayIteratorPrototype%': hasSymbols$1 && getProto ? getProto([][Symbol.iterator]()) : undefined$1,
617664
'%AsyncFromSyncIteratorPrototype%': undefined$1,
618665
'%AsyncFunction%': needsEval,
619666
'%AsyncGenerator%': needsEval,
@@ -643,10 +690,10 @@
643690
'%Int32Array%': typeof Int32Array === 'undefined' ? undefined$1 : Int32Array,
644691
'%isFinite%': isFinite,
645692
'%isNaN%': isNaN,
646-
'%IteratorPrototype%': hasSymbols$1 ? getProto(getProto([][Symbol.iterator]())) : undefined$1,
693+
'%IteratorPrototype%': hasSymbols$1 && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined$1,
647694
'%JSON%': typeof JSON === 'object' ? JSON : undefined$1,
648695
'%Map%': typeof Map === 'undefined' ? undefined$1 : Map,
649-
'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols$1 ? undefined$1 : getProto(new Map()[Symbol.iterator]()),
696+
'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols$1 || !getProto ? undefined$1 : getProto(new Map()[Symbol.iterator]()),
650697
'%Math%': Math,
651698
'%Number%': Number,
652699
'%Object%': Object,
@@ -659,10 +706,10 @@
659706
'%Reflect%': typeof Reflect === 'undefined' ? undefined$1 : Reflect,
660707
'%RegExp%': RegExp,
661708
'%Set%': typeof Set === 'undefined' ? undefined$1 : Set,
662-
'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols$1 ? undefined$1 : getProto(new Set()[Symbol.iterator]()),
709+
'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols$1 || !getProto ? undefined$1 : getProto(new Set()[Symbol.iterator]()),
663710
'%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined$1 : SharedArrayBuffer,
664711
'%String%': String,
665-
'%StringIteratorPrototype%': hasSymbols$1 ? getProto(''[Symbol.iterator]()) : undefined$1,
712+
'%StringIteratorPrototype%': hasSymbols$1 && getProto ? getProto(''[Symbol.iterator]()) : undefined$1,
666713
'%Symbol%': hasSymbols$1 ? Symbol : undefined$1,
667714
'%SyntaxError%': $SyntaxError,
668715
'%ThrowTypeError%': ThrowTypeError,
@@ -678,12 +725,14 @@
678725
'%WeakSet%': typeof WeakSet === 'undefined' ? undefined$1 : WeakSet
679726
};
680727

681-
try {
682-
null.error; // eslint-disable-line no-unused-expressions
683-
} catch (e) {
684-
// https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229
685-
var errorProto = getProto(getProto(e));
686-
INTRINSICS['%Error.prototype%'] = errorProto;
728+
if (getProto) {
729+
try {
730+
null.error; // eslint-disable-line no-unused-expressions
731+
} catch (e) {
732+
// https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229
733+
var errorProto = getProto(getProto(e));
734+
INTRINSICS['%Error.prototype%'] = errorProto;
735+
}
687736
}
688737

689738
var doEval = function doEval(name) {
@@ -701,7 +750,7 @@
701750
}
702751
} else if (name === '%AsyncIteratorPrototype%') {
703752
var gen = doEval('%AsyncGenerator%');
704-
if (gen) {
753+
if (gen && getProto) {
705754
value = getProto(gen.prototype);
706755
}
707756
}
@@ -1894,7 +1943,6 @@
18941943
};
18951944

18961945
var isArray$3 = Array.isArray;
1897-
var split = String.prototype.split;
18981946
var push = Array.prototype.push;
18991947
var pushToArray = function (arr, valueOrArray) {
19001948
push.apply(arr, isArray$3(valueOrArray) ? valueOrArray : [valueOrArray]);
@@ -1996,14 +2044,6 @@
19962044
if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {
19972045
if (encoder) {
19982046
var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format);
1999-
if (generateArrayPrefix === 'comma' && encodeValuesOnly) {
2000-
var valuesArray = split.call(String(obj), ',');
2001-
var valuesJoined = '';
2002-
for (var i = 0; i < valuesArray.length; ++i) {
2003-
valuesJoined += (i === 0 ? '' : ',') + formatter(encoder(valuesArray[i], defaults.encoder, charset, 'value', format));
2004-
}
2005-
return [formatter(keyValue) + (commaRoundTrip && isArray$3(obj) && valuesArray.length === 1 ? '[]' : '') + '=' + valuesJoined];
2006-
}
20072047
return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))];
20082048
}
20092049
return [formatter(prefix) + '=' + formatter(String(obj))];
@@ -2018,6 +2058,9 @@
20182058
var objKeys;
20192059
if (generateArrayPrefix === 'comma' && isArray$3(obj)) {
20202060
// we need to join elements in
2061+
if (encodeValuesOnly && encoder) {
2062+
obj = utils.maybeMap(obj, encoder);
2063+
}
20212064
objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];
20222065
} else if (isArray$3(filter)) {
20232066
objKeys = filter;
@@ -2050,7 +2093,7 @@
20502093
commaRoundTrip,
20512094
strictNullHandling,
20522095
skipNulls,
2053-
encoder,
2096+
generateArrayPrefix === 'comma' && encodeValuesOnly && isArray$3(obj) ? null : encoder,
20542097
filter,
20552098
sort,
20562099
allowDots,
@@ -2247,7 +2290,8 @@
22472290
var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')
22482291

22492292
var parseValues = function parseQueryStringValues(str, options) {
2250-
var obj = {};
2293+
var obj = { __proto__: null };
2294+
22512295
var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
22522296
var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
22532297
var parts = cleanStr.split(options.delimiter, limit);

dist/cordova-auth0-plugin.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/cordova-auth0-plugin.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/authentication/db-connection.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,14 @@ DBConnection.prototype.changePassword = function (options, cb) {
124124
.end(responseHandler(cb));
125125
};
126126

127-
DBConnection.prototype.getChallenge = function (cb) {
127+
DBConnection.prototype.getPasswordResetChallenge = function (cb) {
128128
assert.check(cb, { type: 'function', message: 'cb parameter is not valid' });
129129

130130
if (!this.baseOptions.state) {
131131
return cb();
132132
}
133133

134-
var url = urljoin(this.baseOptions.rootUrl, 'dbconnections', 'challenge');
134+
var url = urljoin(this.baseOptions.rootUrl, 'dbconnections', 'change_password', 'challenge');
135135

136136
return this.request
137137
.post(url)

0 commit comments

Comments
 (0)