@whippsp/auth0-helper 1.1.1 → 1.1.3

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/Auth0Helper.js CHANGED
@@ -27,7 +27,7 @@ module.exports = function(userModule, initialConfig = {}) {
27
27
  runtimeConfig = { ...runtimeConfig, ...newConfig };
28
28
  };
29
29
 
30
- api.user.hasRole = (requestedRole) => {
30
+ api.user.hasrole = (requestedRole) => {
31
31
  const roles = event.authorization?.roles || [];
32
32
  const hasIt = roles.includes(requestedRole);
33
33
 
@@ -42,8 +42,12 @@ module.exports = function(userModule, initialConfig = {}) {
42
42
  };
43
43
 
44
44
  if (event.transaction?.metadata?.skipremainingactions === 'true') {
45
- log(`Skipping Action execution.`);
46
- return;
45
+ if(runtimeConfig.ignoreskip != true)
46
+ {
47
+ log(`Skipping Action execution.`);
48
+ return;
49
+ }
50
+ log(`Ignoring Skip.`);
47
51
  }
48
52
 
49
53
  api.skipRemaining = () => {
package/index.d.ts CHANGED
@@ -5,6 +5,13 @@ export interface HelperConfig {
5
5
  }
6
6
 
7
7
  declare global {
8
+
9
+ interface UserAPI {
10
+ /** * Returns true if the user has the specified Auth0 Role
11
+ */
12
+ hasRole(roleName: string): boolean;
13
+ }
14
+
8
15
  // This covers Post-Login
9
16
  interface PostLoginAPI {
10
17
  skipRemaining(): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whippsp/auth0-helper",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "description": "A helper to override Auth0 Actions handlers with skip logic.",
5
5
  "main": "Auth0Helper.js",
6
6
  "types": "index.d.ts",