@australiangreens/ag-internal-components 0.0.99 → 0.1.1
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/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/components/AuthGuard/AuthGuard.d.ts +11 -1
- package/dist/components/AuthGuard/AuthGuard.d.ts.map +1 -1
- package/dist/components/AuthGuard/auth0ErrorParsing.d.ts +7 -6
- package/dist/components/AuthGuard/auth0ErrorParsing.d.ts.map +1 -1
- package/dist/esm/index.js +418 -381
- package/dist/esm/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
2
|
export interface AuthGuardProps {
|
|
3
3
|
appName?: string;
|
|
4
|
+
/** Defaults to 'unknown'. 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 or if its a completely
|
|
8
|
+
* unknown error without a description etc.*/
|
|
9
|
+
throwErrors?: 'none' | 'unknown' | 'all';
|
|
10
|
+
/** Called in case of an authentication error, regardless of if its recognised
|
|
11
|
+
* or not */
|
|
12
|
+
onError?: (error: Error) => void;
|
|
13
|
+
disableConsoleLogging?: boolean;
|
|
4
14
|
}
|
|
5
15
|
/**
|
|
6
16
|
* Use as parent of main app (but within Auth0Provider) so when an anonymous
|
|
@@ -15,5 +25,5 @@ export interface AuthGuardProps {
|
|
|
15
25
|
*
|
|
16
26
|
* Do not use this if any routes need to be accessible to anonymous users.
|
|
17
27
|
*/
|
|
18
|
-
export default function AuthGuard({ children, appName, }: PropsWithChildren<AuthGuardProps>): JSX.Element;
|
|
28
|
+
export default function AuthGuard({ children, appName, throwErrors, disableConsoleLogging, onError, }: PropsWithChildren<AuthGuardProps>): JSX.Element;
|
|
19
29
|
//# 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;
|
|
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;IAEjB;;;;iDAI6C;IAC7C,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,WAAoB,EACpB,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
|
|
@@ -23,4 +17,11 @@ export declare function errorFromApplicationAccessRejection(errorObject: OAuthEr
|
|
|
23
17
|
* first login.
|
|
24
18
|
*/
|
|
25
19
|
export declare function errorFromUserNotAuthorisingApp(errorObject: OAuthError): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Will only return true if the error looks like it was due to script execution
|
|
22
|
+
* time issue. Specifically, the execution of custom actions in the login flow
|
|
23
|
+
* exceeded the time limit (20s at time of writing). Mostly likely issues
|
|
24
|
+
* syncing user data with AG internal systems.
|
|
25
|
+
*/
|
|
26
|
+
export declare function errorFromScriptExecutionTimeout(errorObject: OAuthError): false | RegExpMatchArray | null;
|
|
26
27
|
//# sourceMappingURL=auth0ErrorParsing.d.ts.map
|
|
@@ -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,
|
|
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;AAED;;;;;GAKG;AACH,wBAAgB,+BAA+B,CAAC,WAAW,EAAE,UAAU,mCAKtE"}
|