@meistrari/auth-nuxt 3.10.0 → 3.10.1

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/README.md CHANGED
@@ -32,9 +32,9 @@ export default defineNuxtConfig({
32
32
  })
33
33
  ```
34
34
 
35
- Application auth auto-imports `useTelaApplicationAuth()`, registers `<TelaRole>`, installs role directives, and adds SDK routes under `/auth/*` plus `/api/auth/api-key/**`. `useTelaApiKey()` is also available; in application mode it targets the local API key proxy for app-scoped user API keys.
35
+ Application auth auto-imports `useTelaApplicationAuth()` and the application-mode `useTelaOrganization()`, registers `<TelaRole>`, installs role directives, and adds SDK routes under `/auth/*` plus `/api/auth/api-key/**` and `/api/auth/organization/**`. `useTelaApiKey()` is also available; in application mode it targets the local API key proxy for app-scoped user API keys.
36
36
 
37
- First-party auth auto-imports `useTelaSession()`, `useTelaOrganization()`, and `useTelaApiKey()`.
37
+ First-party auth auto-imports `useTelaSession()`, `useTelaSessionAssurance()`, `useTelaOrganization()`, and `useTelaApiKey()`.
38
38
 
39
39
  ## API Reference
40
40
 
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@meistrari/auth-nuxt",
3
3
  "configKey": "telaAuth",
4
- "version": "3.10.0",
4
+ "version": "3.10.1",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
package/dist/module.mjs CHANGED
@@ -28,6 +28,11 @@ const module$1 = defineNuxtModule({
28
28
  as: "useTelaOrganization",
29
29
  from: resolver.resolve("runtime/composables/application/organization")
30
30
  });
31
+ addImports({
32
+ name: "useTelaSessionAssurance",
33
+ as: "useTelaSessionAssurance",
34
+ from: resolver.resolve("runtime/composables/application/session-assurance")
35
+ });
31
36
  addComponent({
32
37
  name: "TelaRole",
33
38
  filePath: resolver.resolve("./runtime/components/tela-role.vue"),
@@ -0,0 +1,8 @@
1
+ import type { Ref } from 'vue';
2
+ import type { JWTPayload } from '@meistrari/auth-core';
3
+ export type ApplicationSessionAssuranceValue = JWTPayload['assurance'] | null;
4
+ export interface UseTelaApplicationSessionAssuranceReturn {
5
+ assurance: Readonly<Ref<ApplicationSessionAssuranceValue>>;
6
+ refreshSessionAssurance: () => Promise<ApplicationSessionAssuranceValue>;
7
+ }
8
+ export declare function useTelaSessionAssurance(): UseTelaApplicationSessionAssuranceReturn;
@@ -0,0 +1,21 @@
1
+ import { useRequestFetch } from "#app";
2
+ import { readonly } from "vue";
3
+ import { useApplicationSessionState } from "../state.js";
4
+ export function useTelaSessionAssurance() {
5
+ const { activeOrganization, sessionAssurance, user } = useApplicationSessionState();
6
+ const assurance = readonly(sessionAssurance);
7
+ const requestFetch = useRequestFetch();
8
+ async function refreshSessionAssurance() {
9
+ const result = await requestFetch("/auth/refresh", {
10
+ method: "POST"
11
+ });
12
+ user.value = result.user;
13
+ activeOrganization.value = result.organization;
14
+ sessionAssurance.value = result.assurance;
15
+ return result.assurance;
16
+ }
17
+ return {
18
+ assurance,
19
+ refreshSessionAssurance
20
+ };
21
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meistrari/auth-nuxt",
3
- "version": "3.10.0",
3
+ "version": "3.10.1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {