@moreillon/vue-oidc 0.0.11 → 0.0.12

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 type OidcClient from "@moreillon/oidc-auth";
2
2
  declare function login(): void;
3
3
  declare function logout(): void;
4
4
  export default function (): {
5
+ ready: import("vue").Ref<boolean, boolean>;
5
6
  client: import("vue").Ref<{
6
7
  cookieName: string;
7
8
  options: {
@@ -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,
@@ -6,6 +6,7 @@ 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
+ auth.ready.value = true;
9
10
  if (!oidcData)
10
11
  return;
11
12
  const { user, tokens: { access_token }, } = oidcData;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moreillon/vue-oidc",
3
- "version": "0.0.11",
3
+ "version": "0.0.12",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"