@meistrari/auth-nuxt 3.12.0 → 3.13.0

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/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@meistrari/auth-nuxt",
3
3
  "configKey": "telaAuth",
4
- "version": "3.12.0",
4
+ "version": "3.13.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
package/dist/module.mjs CHANGED
@@ -115,6 +115,11 @@ const module$1 = defineNuxtModule({
115
115
  as: "useTelaOrganization",
116
116
  from: resolver.resolve("runtime/composables/organization")
117
117
  });
118
+ addImports({
119
+ name: "useCoreAuthClient",
120
+ as: "useCoreAuthClient",
121
+ from: resolver.resolve("runtime/composables/core-auth-client")
122
+ });
118
123
  addImports({
119
124
  name: "useTelaAdmin",
120
125
  as: "useTelaAdmin",
@@ -0,0 +1,10 @@
1
+ import type { AuthClient } from '@meistrari/auth-core';
2
+ /**
3
+ * **DO NOT USE** this directly unless you're working on the internals of the Auth System.
4
+ *
5
+ * Allows access to the core AuthClient instance configured for use within a Nuxt application.
6
+ * This makes it possible to use SDKs features not directly exposed by the `@meistrari/auth-nuxt` package.
7
+ *
8
+ * @returns The configured core AuthClient instance
9
+ */
10
+ export declare function useCoreAuthClient(): AuthClient;
@@ -0,0 +1,12 @@
1
+ import { useCookie, useRuntimeConfig } from "#app";
2
+ import { createNuxtAuthClient } from "../shared.js";
3
+ let client;
4
+ export function useCoreAuthClient() {
5
+ const { application, apiUrl, jwtCookieName } = useRuntimeConfig().public.telaAuth;
6
+ if (application?.enabled) {
7
+ throw new Error("Core AuthClient is not available for applications");
8
+ }
9
+ const cookie = useCookie(jwtCookieName);
10
+ client ??= createNuxtAuthClient(apiUrl, () => cookie.value ?? null);
11
+ return client;
12
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meistrari/auth-nuxt",
3
- "version": "3.12.0",
3
+ "version": "3.13.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -36,7 +36,7 @@
36
36
  "docs": "nuxt-module-build prepare && typedoc"
37
37
  },
38
38
  "dependencies": {
39
- "@meistrari/auth-core": "1.23.0",
39
+ "@meistrari/auth-core": "1.24.0",
40
40
  "jose": "6.1.3"
41
41
  },
42
42
  "peerDependencies": {