@samhammer/authentication-vue 2.0.2 → 2.0.4

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/lib/AuthPlugin.js CHANGED
@@ -24,15 +24,17 @@ export class AuthPlugin {
24
24
  return this.guest.authenticated ? this.guest.getGuestId() : this.keycloak.getToken();
25
25
  }
26
26
  initOnce = once(async (authOptions) => {
27
- console.log("Init once for auth plugin");
27
+ console.log("initOnce coming");
28
28
  this.authOptions = authOptions;
29
29
  const guestAuthenticated = this.guest.init(this.authOptions);
30
- const keyCloakAuthenticated = await this.keycloak.init(this.authOptions);
31
- console.log("Check authenticated - " + guestAuthenticated);
32
30
  if (guestAuthenticated) {
31
+ console.log("initOnce emit guest authenticated");
33
32
  AuthEvents.emit(AuthEventNames.isGuestAuthenticated);
33
+ return;
34
34
  }
35
+ const keyCloakAuthenticated = await this.keycloak.init(this.authOptions);
35
36
  if (keyCloakAuthenticated) {
37
+ console.log("initOnce emit keycloak authenticated");
36
38
  AuthEvents.emit(AuthEventNames.isAlreadyAuthenticated);
37
39
  }
38
40
  });
@@ -53,6 +55,7 @@ export class AuthPlugin {
53
55
  return this.keycloak.createLogoutUrl(redirectUri);
54
56
  }
55
57
  async update() {
58
+ console.log("Run into update");
56
59
  const authenticated = await this.keycloak.initKeycloak();
57
60
  if (authenticated) {
58
61
  AuthEvents.emit(AuthEventNames.isAlreadyAuthenticated);
@@ -207,7 +210,6 @@ class GuestPlugin {
207
210
  return this.pluginState?.guestId ?? "";
208
211
  }
209
212
  init(authOptions) {
210
- console.log("Init Guest for:" + authOptions.guestClientId);
211
213
  if (!authOptions.guestClientId) {
212
214
  return false;
213
215
  }
@@ -223,7 +225,6 @@ class GuestPlugin {
223
225
  guestId: guestId,
224
226
  guestRoles: guestRoles
225
227
  };
226
- console.log("Return authen:" + this.authenticated);
227
228
  return this.authenticated;
228
229
  }
229
230
  login(authOptions) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@samhammer/authentication-vue",
3
- "version": "2.0.2",
3
+ "version": "2.0.4",
4
4
  "description": "Keycloak authentication for VueJS projects",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",