@luizleon/sf.prefeiturasp.vuecomponents 0.0.61 → 0.0.63

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luizleon/sf.prefeiturasp.vuecomponents",
3
- "version": "0.0.61",
3
+ "version": "0.0.63",
4
4
  "type": "module",
5
5
  "main": "dist/sf.prefeiturasp.vuecomponents.umd.js",
6
6
  "module": "dist/sf.prefeiturasp.vuecomponents.es.js",
@@ -23,7 +23,13 @@ async function CheckSilentLoginFile() {
23
23
  return result;
24
24
  }
25
25
 
26
- function AuthService(config: KeycloakConfig): IAuthService {
26
+ let AuthService: IAuthService;
27
+
28
+ function ConfigAuthService(config?: KeycloakConfig): IAuthService {
29
+ if (!config) {
30
+ return AuthService;
31
+ }
32
+
27
33
  const keycloakInstance = new Keycloak(config);
28
34
 
29
35
  const User: User = {} as User;
@@ -93,7 +99,13 @@ function AuthService(config: KeycloakConfig): IAuthService {
93
99
  };
94
100
  }
95
101
 
96
- const UseAuthService = (config: KeycloakConfig) =>
97
- AuthService(config);
102
+ /**
103
+ * Serviço de autenticação.
104
+ * O parâmetro config só deve ser passado uma única vez, no início da aplicação.
105
+ * @param config
106
+ * @returns
107
+ */
108
+ const UseAuthService = (config?: KeycloakConfig) =>
109
+ ConfigAuthService(config);
98
110
 
99
111
  export { UseAuthService };