@luizleon/sf.prefeiturasp.vuecomponents 0.0.32 → 0.0.33
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/dist/lib.es.js +118 -118
- package/dist/lib.es.js.map +1 -1
- package/dist/lib.umd.js +7 -7
- package/dist/lib.umd.js.map +1 -1
- package/dist/services/authService.d.ts +2 -2
- package/package.json +1 -1
- package/src/services/authService.ts +6 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Keycloak, { KeycloakConfig } from "./../keycloak";
|
|
1
|
+
import Keycloak, { KeycloakConfig, KeycloakInitOptions } from "./../keycloak";
|
|
2
2
|
interface User {
|
|
3
3
|
name: string;
|
|
4
4
|
email: string;
|
|
@@ -14,7 +14,7 @@ interface User {
|
|
|
14
14
|
declare const UseAuthService: (config: KeycloakConfig) => {
|
|
15
15
|
Instance: Keycloak;
|
|
16
16
|
User: User;
|
|
17
|
-
CallLogin: (onSuccess: () => void, onError: (error: any) => void) => void;
|
|
17
|
+
CallLogin: (initOptions: KeycloakInitOptions, onSuccess: () => void, onError: (error: any) => void) => void;
|
|
18
18
|
CallLogout: () => void;
|
|
19
19
|
};
|
|
20
20
|
export { UseAuthService };
|
package/package.json
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import Keycloak, {
|
|
1
|
+
import Keycloak, {
|
|
2
|
+
KeycloakConfig,
|
|
3
|
+
KeycloakInitOptions,
|
|
4
|
+
} from "./../keycloak";
|
|
2
5
|
|
|
3
6
|
interface User {
|
|
4
7
|
name: string;
|
|
@@ -19,11 +22,12 @@ function AuthService(config: KeycloakConfig) {
|
|
|
19
22
|
const User: User = {} as User;
|
|
20
23
|
|
|
21
24
|
const Login = (
|
|
25
|
+
initOptions: KeycloakInitOptions,
|
|
22
26
|
onSuccess: () => void,
|
|
23
27
|
onError: (error: any) => void
|
|
24
28
|
) => {
|
|
25
29
|
keycloakInstance
|
|
26
|
-
.init(
|
|
30
|
+
.init(initOptions)
|
|
27
31
|
.then(async (authenticated) => {
|
|
28
32
|
if (authenticated) {
|
|
29
33
|
await FetchUserInfo();
|