@australiangreens/ag-internal-components 0.0.98 → 0.1.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.
@@ -1,6 +1,15 @@
1
1
  import { PropsWithChildren } from 'react';
2
2
  export interface AuthGuardProps {
3
3
  appName?: string;
4
+ /** Defaults to 'none'. If set to 'all', will always re-throw the error, so
5
+ * won't display the normal message to user and be handled elsewhere in the
6
+ * app. If set to 'unknown', this will only be done if the failure reason
7
+ * couldn't be inferred from the error description etc. */
8
+ throwErrors?: 'none' | 'unknown' | 'all';
9
+ /** Called in case of an authentication error, regardless of if its recognised
10
+ * or not */
11
+ onError?: (error: Error) => void;
12
+ disableConsoleLogging?: boolean;
4
13
  }
5
14
  /**
6
15
  * Use as parent of main app (but within Auth0Provider) so when an anonymous
@@ -15,5 +24,5 @@ export interface AuthGuardProps {
15
24
  *
16
25
  * Do not use this if any routes need to be accessible to anonymous users.
17
26
  */
18
- export default function AuthGuard({ children, appName, }: PropsWithChildren<AuthGuardProps>): JSX.Element;
27
+ export default function AuthGuard({ children, appName, throwErrors, disableConsoleLogging, onError, }: PropsWithChildren<AuthGuardProps>): JSX.Element;
19
28
  //# sourceMappingURL=AuthGuard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AuthGuard.d.ts","sourceRoot":"","sources":["../../../src/components/AuthGuard/AuthGuard.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,iBAAiB,EAAa,MAAM,OAAO,CAAC;AASrD,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,QAAQ,EACR,OAAmB,GACpB,EAAE,iBAAiB,CAAC,cAAc,CAAC,eAkDnC"}
1
+ {"version":3,"file":"AuthGuard.d.ts","sourceRoot":"","sources":["../../../src/components/AuthGuard/AuthGuard.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,iBAAiB,EAAa,MAAM,OAAO,CAAC;AAQrD,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;8DAG0D;IAC1D,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,KAAK,CAAC;IAEzC;gBACY;IACZ,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAEjC,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,QAAQ,EACR,OAAmB,EACnB,WAAW,EACX,qBAA6B,EAC7B,OAAkB,GACnB,EAAE,iBAAiB,CAAC,cAAc,CAAC,eA4EnC"}
@@ -5,12 +5,6 @@ import { OAuthError } from '@auth0/auth0-react';
5
5
  * seems to be guaranteed
6
6
  */
7
7
  export declare function isOAuthError(error: Error): error is OAuthError;
8
- /**
9
- * Will only return true if the error looks like it was caused by our custom
10
- * Application-Access and Role-Based-Application-Access actions in the login
11
- * flow of auth0 tenant. See README.md for detail
12
- */
13
- export declare function errorFromAuthorisationFailure(errorObject: OAuthError): boolean;
14
8
  /**
15
9
  * Will only return true if the error looks like it was caused by our custom
16
10
  * Application-Access and Role-Based-Application-Access actions in the login
@@ -1 +1 @@
1
- {"version":3,"file":"auth0ErrorParsing.d.ts","sourceRoot":"","sources":["../../../src/components/AuthGuard/auth0ErrorParsing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,UAAU,CAE9D;AAED;;;;GAIG;AACH,wBAAgB,6BAA6B,CAAC,WAAW,EAAE,UAAU,WAEpE;AAED;;;;GAIG;AACH,wBAAgB,mCAAmC,CAAC,WAAW,EAAE,UAAU,WAQ1E;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,CAAC,WAAW,EAAE,UAAU,WAOrE"}
1
+ {"version":3,"file":"auth0ErrorParsing.d.ts","sourceRoot":"","sources":["../../../src/components/AuthGuard/auth0ErrorParsing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,UAAU,CAE9D;AAED;;;;GAIG;AACH,wBAAgB,mCAAmC,CAAC,WAAW,EAAE,UAAU,WAQ1E;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,CAAC,WAAW,EAAE,UAAU,WAOrE"}