@ssplib/react-components 0.0.328 → 0.0.330
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/components/navbar/NavBar.d.ts +7 -1
- package/components/navbar/TabNavBar.d.ts +7 -1
- package/components/providers/KeycloakAuthProvider.d.ts +29 -3
- package/components/providers/OAuthProvider.d.ts +2 -1
- package/index.cjs +2 -2
- package/index.cjs.map +1 -1
- package/index.d.ts +1 -0
- package/index.esm.js +2 -2
- package/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/types/auth.d.ts +61 -7
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { LoginOptions, LogoutOptions } from '../../types/auth';
|
|
2
|
+
export default function NavBar({ links, title, img, pos, next, el, menuItems, paddingBottom, logoutMsg, logoutFunc, loginOptions, logoutOptions, ...props }: {
|
|
2
3
|
links: {
|
|
3
4
|
name: string;
|
|
4
5
|
path: string;
|
|
@@ -10,6 +11,11 @@ export default function NavBar({ links, title, img, pos, next, el, menuItems, pa
|
|
|
10
11
|
next?: boolean;
|
|
11
12
|
el?: JSX.Element;
|
|
12
13
|
logoutMsg?: string;
|
|
14
|
+
/** @deprecated Use logoutOptions.onBeforeLogout instead */
|
|
13
15
|
logoutFunc?: () => Promise<void>;
|
|
14
16
|
pos?: 'fixed' | 'inherit';
|
|
17
|
+
/** Opções para configurar o comportamento do login (redirectUri, callbacks, etc) */
|
|
18
|
+
loginOptions?: LoginOptions;
|
|
19
|
+
/** Opções para configurar o comportamento do logout (redirectUri, callbacks, etc) */
|
|
20
|
+
logoutOptions?: LogoutOptions;
|
|
15
21
|
}): JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { LoginOptions, LogoutOptions } from '../../types/auth';
|
|
2
|
+
export default function TabNavBar({ links, title, img, pos, next, el, menuItems, color, route, paddingBottom, logoutMsg, customBgColor, logoutFunc, loginOptions, logoutOptions, ...props }: {
|
|
2
3
|
links: {
|
|
3
4
|
name: string;
|
|
4
5
|
path: string;
|
|
@@ -12,7 +13,12 @@ export default function TabNavBar({ links, title, img, pos, next, el, menuItems,
|
|
|
12
13
|
next?: boolean;
|
|
13
14
|
el?: JSX.Element;
|
|
14
15
|
logoutMsg?: string;
|
|
16
|
+
/** @deprecated Use logoutOptions.onBeforeLogout instead */
|
|
15
17
|
logoutFunc?: () => Promise<void>;
|
|
16
18
|
pos?: 'fixed' | 'inherit';
|
|
17
19
|
customBgColor?: string;
|
|
20
|
+
/** Opções para configurar o comportamento do login (redirectUri, callbacks, etc) */
|
|
21
|
+
loginOptions?: LoginOptions;
|
|
22
|
+
/** Opções para configurar o comportamento do logout (redirectUri, callbacks, etc) */
|
|
23
|
+
logoutOptions?: LogoutOptions;
|
|
18
24
|
}): JSX.Element;
|
|
@@ -1,10 +1,36 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { User } from '../../types/auth';
|
|
1
3
|
export declare const cookieName = "nextauth.token";
|
|
2
|
-
|
|
4
|
+
interface KeycloakAuthProviderProps {
|
|
5
|
+
/** URL do servidor Keycloak */
|
|
3
6
|
url: string;
|
|
7
|
+
/** Realm do Keycloak */
|
|
4
8
|
realm: string;
|
|
9
|
+
/** Client ID registrado no Keycloak */
|
|
5
10
|
clientId: string;
|
|
6
|
-
|
|
11
|
+
/** Componentes filhos */
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
/** Tipo de autenticação */
|
|
7
14
|
type?: 'govbr' | 'ad';
|
|
15
|
+
/** Nome do recurso para extrair roles */
|
|
8
16
|
resource_name?: string;
|
|
17
|
+
/** URL de redirecionamento após login */
|
|
9
18
|
redirectUri?: string;
|
|
10
|
-
|
|
19
|
+
/** Callback executado quando autenticação é bem-sucedida */
|
|
20
|
+
onAuthSuccess?: (user: User) => void;
|
|
21
|
+
/** Callback executado quando autenticação falha */
|
|
22
|
+
onAuthError?: (error: Error) => void;
|
|
23
|
+
/** Habilita logs de debug (apenas em desenvolvimento) */
|
|
24
|
+
enableDebugLogs?: boolean;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Provider de autenticação Keycloak
|
|
28
|
+
*
|
|
29
|
+
* Gerencia todo o fluxo de autenticação incluindo:
|
|
30
|
+
* - Inicialização e verificação de SSO
|
|
31
|
+
* - Renovação automática de tokens
|
|
32
|
+
* - Login e logout com callbacks personalizáveis
|
|
33
|
+
* - Verificação de roles
|
|
34
|
+
*/
|
|
35
|
+
export declare function KeycloakAuthProvider({ url, realm, clientId, children, type, resource_name, redirectUri, onAuthSuccess, onAuthError, enableDebugLogs, }: KeycloakAuthProviderProps): JSX.Element;
|
|
36
|
+
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
interface OiDcConfig {
|
|
2
3
|
client_id: string;
|
|
3
4
|
scope: string;
|
|
@@ -6,7 +7,7 @@ interface OiDcConfig {
|
|
|
6
7
|
}
|
|
7
8
|
export declare const cookieName = "nextauth.token";
|
|
8
9
|
export declare function OAuthProvider({ children, AUTH_URL, oidcConfig, redirectURL, validateTokenRoute, testToken, testIP, logoutURL, }: {
|
|
9
|
-
children:
|
|
10
|
+
children: React.ReactNode;
|
|
10
11
|
AUTH_URL: string;
|
|
11
12
|
oidcConfig: OiDcConfig;
|
|
12
13
|
redirectURL: string;
|