@ssplib/react-components 0.0.80 → 0.0.82

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.
@@ -128,7 +128,7 @@ function FileUpload({ name, tipoArquivo, title, required = false, multiple = fal
128
128
  if (v.length <= 0 && required)
129
129
  return 'O campo de arquivo é obrigatório';
130
130
  },
131
- }), { onChange: onFile, accept: 'image/*', style: { display: 'none' } })),
131
+ }), { onChange: onFile, accept: '.jpg, .png, .jpeg', style: { display: 'none' } })),
132
132
  react_1.default.createElement(material_1.Box, { sx: {
133
133
  display: {
134
134
  sx: 'block',
@@ -13,12 +13,13 @@ interface OiDcConfig {
13
13
  CODE_VERIFIER: string;
14
14
  }
15
15
  export declare const cookieName = "nextauth.token";
16
- export declare function OAuthProvider({ children, AUTH_URL, oidcConfig, redirectURL, validateTokenRoute, testToken, }: {
16
+ export declare function OAuthProvider({ children, AUTH_URL, oidcConfig, redirectURL, validateTokenRoute, testToken, testIP, }: {
17
17
  children: JSX.Element | JSX.Element[];
18
18
  AUTH_URL: string;
19
19
  oidcConfig: OiDcConfig;
20
20
  redirectURL: string;
21
21
  validateTokenRoute: string;
22
22
  testToken: string;
23
+ testIP?: string;
23
24
  }): JSX.Element;
24
25
  export {};
@@ -43,7 +43,7 @@ const react_1 = __importStar(require("react"));
43
43
  const auth_1 = require("../../context/auth");
44
44
  exports.cookieName = 'nextauth.token';
45
45
  const userImgName = 'user-data.img';
46
- function OAuthProvider({ children, AUTH_URL, oidcConfig, redirectURL, validateTokenRoute, testToken, }) {
46
+ function OAuthProvider({ children, AUTH_URL, oidcConfig, redirectURL, validateTokenRoute, testToken, testIP, }) {
47
47
  const govBrURL = oidcConfig.authority + '/authorize?response_type=code&client_id=' + oidcConfig.client_id + '&scope=' + oidcConfig.scope + '&redirect_uri=' + oidcConfig.redirect_uri;
48
48
  const [user, setUser] = (0, react_1.useState)();
49
49
  const [userLoaded, setUserLoaded] = (0, react_1.useState)(false);
@@ -75,7 +75,7 @@ function OAuthProvider({ children, AUTH_URL, oidcConfig, redirectURL, validateTo
75
75
  }, []);
76
76
  function login() {
77
77
  // Teste em localhost
78
- if (location && location.hostname === 'localhost') {
78
+ if (location && (location.hostname === 'localhost' || location.hostname === testIP)) {
79
79
  const token = testToken;
80
80
  (0, cookies_next_1.setCookie)(exports.cookieName, token);
81
81
  setUser({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ssplib/react-components",
3
- "version": "0.0.80",
3
+ "version": "0.0.82",
4
4
  "description": "SSP React Components",
5
5
  "main": "index.js",
6
6
  "author": "Pedro Henrique <sr.hudrick@gmail.com>",