@moreillon/vue-oidc 0.0.11 → 0.0.13
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.
|
@@ -2,6 +2,7 @@ import { ref } from "vue";
|
|
|
2
2
|
const client = ref(null);
|
|
3
3
|
const user = ref(null);
|
|
4
4
|
const access_token = ref(null);
|
|
5
|
+
const ready = ref(false);
|
|
5
6
|
function login() {
|
|
6
7
|
if (!client.value)
|
|
7
8
|
throw new Error("OIDC Client not instanciated");
|
|
@@ -14,6 +15,7 @@ function logout() {
|
|
|
14
15
|
}
|
|
15
16
|
export default function () {
|
|
16
17
|
return {
|
|
18
|
+
ready,
|
|
17
19
|
client,
|
|
18
20
|
user,
|
|
19
21
|
access_token,
|
package/dist/plugins/auth.js
CHANGED
|
@@ -6,6 +6,8 @@ export default {
|
|
|
6
6
|
const auth = useAuth();
|
|
7
7
|
auth.client.value = new OidcClient(oidcOptions);
|
|
8
8
|
const oidcData = await auth.client.value.init(enforce);
|
|
9
|
+
if (!enforce || oidcData)
|
|
10
|
+
auth.ready.value = true;
|
|
9
11
|
if (!oidcData)
|
|
10
12
|
return;
|
|
11
13
|
const { user, tokens: { access_token }, } = oidcData;
|