🚨 Latest Research:Tanstack npm Packages Compromised in Ongoing Mini Shai-Hulud Supply-Chain Attack.Learn More
Socket
Book a DemoSign in
Socket

@frontegg/react-hooks

Package Overview
Dependencies
Maintainers
2
Versions
1243
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@frontegg/react-hooks - npm Package Compare versions

Comparing version
7.105.0-alpha.1
to
7.105.0
+9
-0
auth/security/restrictions.d.ts

@@ -25,1 +25,10 @@ import { RestrictionsActions, RestrictionsState } from '@frontegg/redux-store';

};
export declare const useCountryRestrictions: () => {
loading: boolean;
saving: boolean | undefined;
error: any;
data: {
config: import("dist/@frontegg/rest-api").CountryRestrictionConfig;
restrictions: import("dist/@frontegg/rest-api").CountryRestrictionRule[];
} | undefined;
};

@@ -60,2 +60,24 @@ import { useEffect } from 'react';

};
};
export const useCountryRestrictions = () => {
const {
loading,
data,
saving,
error
} = useRestrictionsState().countryRestrictions;
const {
loadCountryRestrictions
} = useRestrictionsActions();
useEffect(() => {
if (!data && !loading) {
loadCountryRestrictions();
}
}, [loadCountryRestrictions, data, loading]);
return {
loading,
saving,
error,
data
};
};
+1
-1

@@ -1,2 +0,2 @@

/** @license Frontegg v7.105.0-alpha.1
/** @license Frontegg v7.105.0
*

@@ -3,0 +3,0 @@ * This source code is licensed under the MIT license found in the

@@ -6,3 +6,3 @@ "use strict";

});
exports.useRestrictionsActions = exports.useIpRestrictions = exports.useEmailDomainRestrictions = void 0;
exports.useRestrictionsActions = exports.useIpRestrictions = exports.useEmailDomainRestrictions = exports.useCountryRestrictions = void 0;
exports.useRestrictionsState = useRestrictionsState;

@@ -71,2 +71,25 @@ var _react = require("react");

};
exports.useEmailDomainRestrictions = useEmailDomainRestrictions;
exports.useEmailDomainRestrictions = useEmailDomainRestrictions;
const useCountryRestrictions = () => {
const {
loading,
data,
saving,
error
} = useRestrictionsState().countryRestrictions;
const {
loadCountryRestrictions
} = useRestrictionsActions();
(0, _react.useEffect)(() => {
if (!data && !loading) {
loadCountryRestrictions();
}
}, [loadCountryRestrictions, data, loading]);
return {
loading,
saving,
error,
data
};
};
exports.useCountryRestrictions = useCountryRestrictions;

@@ -1,2 +0,2 @@

/** @license Frontegg v7.105.0-alpha.1
/** @license Frontegg v7.105.0
*

@@ -3,0 +3,0 @@ * This source code is licensed under the MIT license found in the

{
"name": "@frontegg/react-hooks",
"version": "7.105.0-alpha.1",
"version": "7.105.0",
"main": "./node/index.js",

@@ -9,4 +9,4 @@ "license": "MIT",

"@babel/runtime": "^7.18.6",
"@frontegg/redux-store": "7.105.0-alpha.1",
"@frontegg/types": "7.105.0-alpha.1",
"@frontegg/redux-store": "7.105.0",
"@frontegg/types": "7.105.0",
"@types/react": "*",

@@ -13,0 +13,0 @@ "@types/react-is": "^17.0.7",