@auth0/auth0-angular 1.10.1 → 1.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -6,11 +6,12 @@
6
6
 
7
7
  # Auth0 Angular SDK
8
8
 
9
- A library for integrating [Auth0](https://auth0.com) into an Angular 9+ application.
9
+ A library for integrating [Auth0](https://auth0.com) into an Angular application.
10
10
 
11
11
  ## Table of Contents
12
12
 
13
13
  - [Documentation](#documentation)
14
+ - [Supported Angular versions](#supported-angular-versions)
14
15
  - [Installation](#installation)
15
16
  - [Getting Started](#getting-started)
16
17
  - [Angular Universal](#angular-universal)
@@ -26,6 +27,9 @@ A library for integrating [Auth0](https://auth0.com) into an Angular 9+ applicat
26
27
  - [API Reference](https://auth0.github.io/auth0-angular/)
27
28
  - [Quickstart Guide](https://auth0.com/docs/quickstart/spa/angular-next)
28
29
 
30
+ ## Supported Angular versions
31
+ This project only supports the [actively supported versions of Angular as stated in the Angular documentation](https://angular.io/guide/releases#actively-supported-versions). Whilst other versions might be compatible they are not actively supported.
32
+
29
33
  ## Installation
30
34
 
31
35
  Using npm:
@@ -1,5 +1,5 @@
1
1
  /**
2
2
  * Generated bundle index. Do not edit.
3
3
  */
4
+ /// <amd-module name="@auth0/auth0-angular" />
4
5
  export * from './public-api';
5
- export { AbstractNavigator as ɵa } from './lib/abstract-navigator';
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@auth0/auth0-spa-js'), require('rxjs'), require('rxjs/operators'), require('@angular/router'), require('@angular/common')) :
3
- typeof define === 'function' && define.amd ? define('@auth0/auth0-angular', ['exports', '@angular/core', '@auth0/auth0-spa-js', 'rxjs', 'rxjs/operators', '@angular/router', '@angular/common'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.auth0 = global.auth0 || {}, global.auth0['auth0-angular'] = {}), global.ng.core, global.auth0SpaJs, global.rxjs, global.rxjs.operators, global.ng.router, global.ng.common));
5
- }(this, (function (exports, i0, auth0SpaJs, rxjs, operators, router, i1) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('rxjs/operators'), require('@auth0/auth0-spa-js'), require('@angular/router'), require('@angular/common')) :
3
+ typeof define === 'function' && define.amd ? define('@auth0/auth0-angular', ['exports', '@angular/core', 'rxjs', 'rxjs/operators', '@auth0/auth0-spa-js', '@angular/router', '@angular/common'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.auth0 = global.auth0 || {}, global.auth0['auth0-angular'] = {}), global.ng.core, global.rxjs, global.rxjs.operators, global.i1, global.ng.router, global.ng.common));
5
+ }(this, (function (exports, i0, rxjs, operators, i1, router, i1$1) { 'use strict';
6
6
 
7
7
  function _interopNamespace(e) {
8
8
  if (e && e.__esModule) return e;
@@ -25,7 +25,8 @@
25
25
  }
26
26
 
27
27
  var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
28
- var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
28
+ var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1);
29
+ var i1__namespace = /*#__PURE__*/_interopNamespace(i1$1);
29
30
 
30
31
  /******************************************************************************
31
32
  Copyright (c) Microsoft Corporation.
@@ -354,7 +355,7 @@
354
355
  return typeof state === "function" ? receiver === state : state.has(receiver);
355
356
  }
356
357
 
357
- var useragent = { name: '@auth0/auth0-angular', version: '1.10.1' };
358
+ var useragent = { name: '@auth0/auth0-angular', version: '1.11.0' };
358
359
 
359
360
  var Auth0ClientFactory = /** @class */ (function () {
360
361
  function Auth0ClientFactory() {
@@ -365,7 +366,7 @@
365
366
  throw new Error('Configuration must be specified either through AuthModule.forRoot or through AuthClientConfig.set');
366
367
  }
367
368
  var redirectUri = config.redirectUri, clientId = config.clientId, maxAge = config.maxAge, httpInterceptor = config.httpInterceptor, rest = __rest(config, ["redirectUri", "clientId", "maxAge", "httpInterceptor"]);
368
- return new auth0SpaJs.Auth0Client(Object.assign(Object.assign({ redirect_uri: redirectUri || window.location.origin, client_id: clientId, max_age: maxAge }, rest), { auth0Client: {
369
+ return new i1.Auth0Client(Object.assign(Object.assign({ redirect_uri: redirectUri || window.location.origin, client_id: clientId, max_age: maxAge }, rest), { auth0Client: {
369
370
  name: useragent.name,
370
371
  version: useragent.version,
371
372
  env: {
@@ -377,39 +378,6 @@
377
378
  }());
378
379
  var Auth0ClientService = new i0.InjectionToken('auth0.client');
379
380
 
380
- var AbstractNavigator = /** @class */ (function () {
381
- function AbstractNavigator(location, injector) {
382
- this.location = location;
383
- try {
384
- this.router = injector.get(router.Router);
385
- }
386
- catch (_a) { }
387
- }
388
- /**
389
- * Navigates to the specified url. The router will be used if one is available, otherwise it falls back
390
- * to `window.history.replaceState`.
391
- * @param url The url to navigate to
392
- */
393
- AbstractNavigator.prototype.navigateByUrl = function (url) {
394
- if (this.router) {
395
- this.router.navigateByUrl(url);
396
- return;
397
- }
398
- this.location.replaceState(url);
399
- };
400
- return AbstractNavigator;
401
- }());
402
- AbstractNavigator.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function AbstractNavigator_Factory() { return new AbstractNavigator(i0__namespace.ɵɵinject(i1__namespace.Location), i0__namespace.ɵɵinject(i0__namespace.INJECTOR)); }, token: AbstractNavigator, providedIn: "root" });
403
- AbstractNavigator.decorators = [
404
- { type: i0.Injectable, args: [{
405
- providedIn: 'root',
406
- },] }
407
- ];
408
- AbstractNavigator.ctorParameters = function () { return [
409
- { type: i1.Location },
410
- { type: i0.Injector }
411
- ]; };
412
-
413
381
  /**
414
382
  * A custom type guard to help identify route definitions that are actually HttpInterceptorRouteConfig types.
415
383
  * @param def The route definition type
@@ -480,13 +448,19 @@
480
448
  };
481
449
  return AuthClientConfig;
482
450
  }());
483
- AuthClientConfig.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function AuthClientConfig_Factory() { return new AuthClientConfig(i0__namespace.ɵɵinject(AuthConfigService, 8)); }, token: AuthClientConfig, providedIn: "root" });
484
- AuthClientConfig.decorators = [
485
- { type: i0.Injectable, args: [{ providedIn: 'root' },] }
486
- ];
487
- AuthClientConfig.ctorParameters = function () { return [
488
- { type: undefined, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [AuthConfigService,] }] }
489
- ]; };
451
+ AuthClientConfig.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: AuthClientConfig, deps: [{ token: AuthConfigService, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
452
+ AuthClientConfig.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: AuthClientConfig, providedIn: 'root' });
453
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: AuthClientConfig, decorators: [{
454
+ type: i0.Injectable,
455
+ args: [{ providedIn: 'root' }]
456
+ }], ctorParameters: function () {
457
+ return [{ type: undefined, decorators: [{
458
+ type: i0.Optional
459
+ }, {
460
+ type: i0.Inject,
461
+ args: [AuthConfigService]
462
+ }] }];
463
+ } });
490
464
  /**
491
465
  * Injection token for accessing configuration.
492
466
  *
@@ -500,6 +474,37 @@
500
474
  */
501
475
  var AuthConfigService = new i0.InjectionToken('auth0-angular.config');
502
476
 
477
+ var AbstractNavigator = /** @class */ (function () {
478
+ function AbstractNavigator(location, injector) {
479
+ this.location = location;
480
+ try {
481
+ this.router = injector.get(router.Router);
482
+ }
483
+ catch (_a) { }
484
+ }
485
+ /**
486
+ * Navigates to the specified url. The router will be used if one is available, otherwise it falls back
487
+ * to `window.history.replaceState`.
488
+ * @param url The url to navigate to
489
+ */
490
+ AbstractNavigator.prototype.navigateByUrl = function (url) {
491
+ if (this.router) {
492
+ this.router.navigateByUrl(url);
493
+ return;
494
+ }
495
+ this.location.replaceState(url);
496
+ };
497
+ return AbstractNavigator;
498
+ }());
499
+ AbstractNavigator.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: AbstractNavigator, deps: [{ token: i1__namespace.Location }, { token: i0__namespace.Injector }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
500
+ AbstractNavigator.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: AbstractNavigator, providedIn: 'root' });
501
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: AbstractNavigator, decorators: [{
502
+ type: i0.Injectable,
503
+ args: [{
504
+ providedIn: 'root',
505
+ }]
506
+ }], ctorParameters: function () { return [{ type: i1__namespace.Location }, { type: i0__namespace.Injector }]; } });
507
+
503
508
  /**
504
509
  * Tracks the Authentication State for the SDK
505
510
  */
@@ -589,13 +594,17 @@
589
594
  };
590
595
  return AuthState;
591
596
  }());
592
- AuthState.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function AuthState_Factory() { return new AuthState(i0__namespace.ɵɵinject(Auth0ClientService)); }, token: AuthState, providedIn: "root" });
593
- AuthState.decorators = [
594
- { type: i0.Injectable, args: [{ providedIn: 'root' },] }
595
- ];
596
- AuthState.ctorParameters = function () { return [
597
- { type: auth0SpaJs.Auth0Client, decorators: [{ type: i0.Inject, args: [Auth0ClientService,] }] }
598
- ]; };
597
+ AuthState.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: AuthState, deps: [{ token: Auth0ClientService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
598
+ AuthState.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: AuthState, providedIn: 'root' });
599
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: AuthState, decorators: [{
600
+ type: i0.Injectable,
601
+ args: [{ providedIn: 'root' }]
602
+ }], ctorParameters: function () {
603
+ return [{ type: i1__namespace$1.Auth0Client, decorators: [{
604
+ type: i0.Inject,
605
+ args: [Auth0ClientService]
606
+ }] }];
607
+ } });
599
608
 
600
609
  var AuthService = /** @class */ (function () {
601
610
  function AuthService(auth0Client, configFactory, navigator, authState) {
@@ -886,18 +895,19 @@
886
895
  };
887
896
  return AuthService;
888
897
  }());
889
- AuthService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function AuthService_Factory() { return new AuthService(i0__namespace.ɵɵinject(Auth0ClientService), i0__namespace.ɵɵinject(AuthClientConfig), i0__namespace.ɵɵinject(AbstractNavigator), i0__namespace.ɵɵinject(AuthState)); }, token: AuthService, providedIn: "root" });
890
- AuthService.decorators = [
891
- { type: i0.Injectable, args: [{
892
- providedIn: 'root',
893
- },] }
894
- ];
895
- AuthService.ctorParameters = function () { return [
896
- { type: auth0SpaJs.Auth0Client, decorators: [{ type: i0.Inject, args: [Auth0ClientService,] }] },
897
- { type: AuthClientConfig },
898
- { type: AbstractNavigator },
899
- { type: AuthState }
900
- ]; };
898
+ AuthService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: AuthService, deps: [{ token: Auth0ClientService }, { token: AuthClientConfig }, { token: AbstractNavigator }, { token: AuthState }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
899
+ AuthService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: AuthService, providedIn: 'root' });
900
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: AuthService, decorators: [{
901
+ type: i0.Injectable,
902
+ args: [{
903
+ providedIn: 'root',
904
+ }]
905
+ }], ctorParameters: function () {
906
+ return [{ type: i1__namespace$1.Auth0Client, decorators: [{
907
+ type: i0.Inject,
908
+ args: [Auth0ClientService]
909
+ }] }, { type: AuthClientConfig }, { type: AbstractNavigator }, { type: AuthState }];
910
+ } });
901
911
 
902
912
  var AuthGuard = /** @class */ (function () {
903
913
  function AuthGuard(auth) {
@@ -924,15 +934,14 @@
924
934
  };
925
935
  return AuthGuard;
926
936
  }());
927
- AuthGuard.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function AuthGuard_Factory() { return new AuthGuard(i0__namespace.ɵɵinject(AuthService)); }, token: AuthGuard, providedIn: "root" });
928
- AuthGuard.decorators = [
929
- { type: i0.Injectable, args: [{
930
- providedIn: 'root',
931
- },] }
932
- ];
933
- AuthGuard.ctorParameters = function () { return [
934
- { type: AuthService }
935
- ]; };
937
+ AuthGuard.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: AuthGuard, deps: [{ token: AuthService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
938
+ AuthGuard.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: AuthGuard, providedIn: 'root' });
939
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: AuthGuard, decorators: [{
940
+ type: i0.Injectable,
941
+ args: [{
942
+ providedIn: 'root',
943
+ }]
944
+ }], ctorParameters: function () { return [{ type: AuthService }]; } });
936
945
 
937
946
  var AuthModule = /** @class */ (function () {
938
947
  function AuthModule() {
@@ -962,9 +971,12 @@
962
971
  };
963
972
  return AuthModule;
964
973
  }());
965
- AuthModule.decorators = [
966
- { type: i0.NgModule }
967
- ];
974
+ AuthModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: AuthModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
975
+ AuthModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: AuthModule });
976
+ AuthModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: AuthModule });
977
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: AuthModule, decorators: [{
978
+ type: i0.NgModule
979
+ }] });
968
980
 
969
981
  var AuthHttpInterceptor = /** @class */ (function () {
970
982
  function AuthHttpInterceptor(configFactory, auth0Client, authState) {
@@ -1082,14 +1094,16 @@
1082
1094
  };
1083
1095
  return AuthHttpInterceptor;
1084
1096
  }());
1085
- AuthHttpInterceptor.decorators = [
1086
- { type: i0.Injectable }
1087
- ];
1088
- AuthHttpInterceptor.ctorParameters = function () { return [
1089
- { type: AuthClientConfig },
1090
- { type: auth0SpaJs.Auth0Client, decorators: [{ type: i0.Inject, args: [Auth0ClientService,] }] },
1091
- { type: AuthState }
1092
- ]; };
1097
+ AuthHttpInterceptor.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: AuthHttpInterceptor, deps: [{ token: AuthClientConfig }, { token: Auth0ClientService }, { token: AuthState }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1098
+ AuthHttpInterceptor.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: AuthHttpInterceptor });
1099
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: AuthHttpInterceptor, decorators: [{
1100
+ type: i0.Injectable
1101
+ }], ctorParameters: function () {
1102
+ return [{ type: AuthClientConfig }, { type: i1__namespace$1.Auth0Client, decorators: [{
1103
+ type: i0.Inject,
1104
+ args: [Auth0ClientService]
1105
+ }] }, { type: AuthState }];
1106
+ } });
1093
1107
 
1094
1108
  /*
1095
1109
  * Public API Surface of auth0-angular
@@ -1102,19 +1116,19 @@
1102
1116
  Object.defineProperty(exports, 'InMemoryCache', {
1103
1117
  enumerable: true,
1104
1118
  get: function () {
1105
- return auth0SpaJs.InMemoryCache;
1119
+ return i1.InMemoryCache;
1106
1120
  }
1107
1121
  });
1108
1122
  Object.defineProperty(exports, 'LocalStorageCache', {
1109
1123
  enumerable: true,
1110
1124
  get: function () {
1111
- return auth0SpaJs.LocalStorageCache;
1125
+ return i1.LocalStorageCache;
1112
1126
  }
1113
1127
  });
1114
1128
  Object.defineProperty(exports, 'User', {
1115
1129
  enumerable: true,
1116
1130
  get: function () {
1117
- return auth0SpaJs.User;
1131
+ return i1.User;
1118
1132
  }
1119
1133
  });
1120
1134
  exports.Auth0ClientFactory = Auth0ClientFactory;
@@ -1127,7 +1141,6 @@
1127
1141
  exports.AuthService = AuthService;
1128
1142
  exports.AuthState = AuthState;
1129
1143
  exports.isHttpInterceptorRouteConfig = isHttpInterceptorRouteConfig;
1130
- exports.ɵa = AbstractNavigator;
1131
1144
 
1132
1145
  Object.defineProperty(exports, '__esModule', { value: true });
1133
1146