@australiangreens/ag-internal-components 0.0.78 → 0.0.79

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.
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=AuthGuard.comp.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AuthGuard.comp.test.d.ts","sourceRoot":"","sources":["../../../src/components/AuthGuard/AuthGuard.comp.test.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,16 @@
1
+ import { PropsWithChildren } from 'react';
2
+ /**
3
+ * Use as parent of main app (but within Auth0Provider) so when an anonymous
4
+ * user visits the will be redirected to the login page and returned to the page
5
+ * they we're redirected from after login.
6
+ *
7
+ * This is similar to the withAuthenticationRequired HOC from Auth0, which
8
+ * operates on a per-route basis.
9
+ *
10
+ * This component is also responsible for detecting an an authorisation error
11
+ * that is triggered by one of our rules defined for our Auth0 tenant
12
+ *
13
+ * Do not use this if any routes need to be accessible to anonymous users.
14
+ */
15
+ export default function AuthGuard({ children }: PropsWithChildren): JSX.Element;
16
+ //# sourceMappingURL=AuthGuard.d.ts.map
@@ -0,0 +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;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAAE,QAAQ,EAAE,EAAE,iBAAiB,eAmDhE"}
@@ -0,0 +1,26 @@
1
+ import { OAuthError } from '@auth0/auth0-react';
2
+ /**
3
+ * instanceof OAuthError doesn't work in for whatever useAuth0 hook returns, so
4
+ * we use duck typing guard. There are other specified properties too, but only error
5
+ * seems to be guaranteed
6
+ */
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
+ /**
15
+ * Will only return true if the error looks like it was caused by our custom
16
+ * Application-Access and Role-Based-Application-Access actions in the login
17
+ * flow of auth0 tenant. See README.md for detail
18
+ */
19
+ export declare function errorFromApplicationAccessRejection(errorObject: OAuthError): boolean;
20
+ /**
21
+ * Will only return true if the error looks like it was caused by a user not
22
+ * granting the application access to their profile in the tenant when asked on
23
+ * first login.
24
+ */
25
+ export declare function errorFromUserNotAuthorisingApp(errorObject: OAuthError): boolean;
26
+ //# sourceMappingURL=auth0ErrorParsing.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,3 @@
1
+ export * from './AuthGuard';
2
+ export { default } from './AuthGuard';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/AuthGuard/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC"}
@@ -1,11 +1,13 @@
1
- export { default as ExampleComponent } from './ExampleComponent';
2
1
  export * from './ExampleComponent';
3
- export { default as NavBar } from './NavBar';
2
+ export { default as ExampleComponent } from './ExampleComponent';
4
3
  export * from './NavBar';
5
- export { default as AgDialog } from './AgDialog';
4
+ export { default as NavBar } from './NavBar';
6
5
  export * from './AgDialog';
7
- export { default as FetchAutocomplete } from './FetchAutocomplete';
6
+ export { default as AgDialog } from './AgDialog';
8
7
  export * from './FetchAutocomplete';
9
- export { default as SingleAutocomplete } from './SingleAutocomplete';
8
+ export { default as FetchAutocomplete } from './FetchAutocomplete';
10
9
  export * from './SingleAutocomplete';
10
+ export { default as SingleAutocomplete } from './SingleAutocomplete';
11
+ export * from './AuthGuard';
12
+ export { default as AuthGuard } from './AuthGuard';
11
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACjE,cAAc,oBAAoB,CAAC;AAEnC,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAC7C,cAAc,UAAU,CAAC;AAEzB,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,cAAc,YAAY,CAAC;AAE3B,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,cAAc,qBAAqB,CAAC;AAEpC,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,cAAc,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEjE,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAE7C,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEjD,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAEnE,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAMrE,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC"}