@samhammer/authentication-vue 2.0.3 → 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 +4 -0
- package/package.json +1 -1
package/lib/AuthPlugin.js
CHANGED
|
@@ -24,14 +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("initOnce coming");
|
|
27
28
|
this.authOptions = authOptions;
|
|
28
29
|
const guestAuthenticated = this.guest.init(this.authOptions);
|
|
29
30
|
if (guestAuthenticated) {
|
|
31
|
+
console.log("initOnce emit guest authenticated");
|
|
30
32
|
AuthEvents.emit(AuthEventNames.isGuestAuthenticated);
|
|
31
33
|
return;
|
|
32
34
|
}
|
|
33
35
|
const keyCloakAuthenticated = await this.keycloak.init(this.authOptions);
|
|
34
36
|
if (keyCloakAuthenticated) {
|
|
37
|
+
console.log("initOnce emit keycloak authenticated");
|
|
35
38
|
AuthEvents.emit(AuthEventNames.isAlreadyAuthenticated);
|
|
36
39
|
}
|
|
37
40
|
});
|
|
@@ -52,6 +55,7 @@ export class AuthPlugin {
|
|
|
52
55
|
return this.keycloak.createLogoutUrl(redirectUri);
|
|
53
56
|
}
|
|
54
57
|
async update() {
|
|
58
|
+
console.log("Run into update");
|
|
55
59
|
const authenticated = await this.keycloak.initKeycloak();
|
|
56
60
|
if (authenticated) {
|
|
57
61
|
AuthEvents.emit(AuthEventNames.isAlreadyAuthenticated);
|