@onmax/nuxt-better-auth 0.0.2-alpha.24 → 0.0.2-alpha.25

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@onmax/nuxt-better-auth",
3
- "version": "0.0.2-alpha.24",
3
+ "version": "0.0.2-alpha.25",
4
4
  "configKey": "auth",
5
5
  "compatibility": {
6
6
  "nuxt": ">=4.0.0"
package/dist/module.mjs CHANGED
@@ -10,7 +10,7 @@ import { randomBytes } from 'node:crypto';
10
10
  import { isCI, isTest } from 'std-env';
11
11
  export { defineClientAuth, defineServerAuth } from '../dist/runtime/config.js';
12
12
 
13
- const version = "0.0.2-alpha.24";
13
+ const version = "0.0.2-alpha.25";
14
14
 
15
15
  function resolveDatabaseProvider(input) {
16
16
  const enabledProviders = Object.entries(input.providers).filter(([_id, provider]) => provider.isEnabled?.(input.context) ?? true);
@@ -142,7 +142,6 @@ function setupRuntimeConfig(input) {
142
142
  if (!configuredSiteUrl && process.env.NUXT_PUBLIC_SITE_URL)
143
143
  nuxt.options.runtimeConfig.public.siteUrl = process.env.NUXT_PUBLIC_SITE_URL;
144
144
  nuxt.options.runtimeConfig.public.auth = defu(nuxt.options.runtimeConfig.public.auth, {
145
- redirects: { login: options.redirects?.login ?? "/login", guest: options.redirects?.guest ?? "/" },
146
145
  preserveRedirect: options.preserveRedirect ?? true,
147
146
  redirectQueryKey: options.redirectQueryKey ?? "redirect",
148
147
  useDatabase: databaseProvider !== "none",
@@ -588,7 +587,6 @@ const module$1 = defineNuxtModule({
588
587
  clientOnly: false,
589
588
  serverConfig: "server/auth.config",
590
589
  clientConfig: "app/auth.config",
591
- redirects: { login: "/login", guest: "/" },
592
590
  preserveRedirect: true,
593
591
  redirectQueryKey: "redirect",
594
592
  secondaryStorage: false
@@ -25,13 +25,13 @@ export default defineNuxtRouteMiddleware(async (to) => {
25
25
  const redirectTo = typeof auth === "object" ? auth.redirectTo : void 0;
26
26
  if (mode === "guest") {
27
27
  if (loggedIn.value)
28
- return navigateTo(redirectTo ?? config?.redirects?.guest ?? "/");
28
+ return navigateTo(redirectTo ?? "/");
29
29
  return;
30
30
  }
31
31
  if (!loggedIn.value) {
32
32
  const resolved = resolveLoginRedirect({
33
33
  route: to,
34
- loginTarget: redirectTo ?? config?.redirects?.login ?? "/login",
34
+ loginTarget: redirectTo ?? "/login",
35
35
  config
36
36
  });
37
37
  return resolved.external ? navigateTo(resolved.to, { external: true }) : navigateTo(resolved.to);
@@ -373,12 +373,6 @@ function getAccountActions(row) {
373
373
  <div class="config-header">
374
374
  <UIcon name="i-lucide-settings-2" class="size-4" /><span>Module</span>
375
375
  </div>
376
- <div class="config-row">
377
- <span class="config-label">Login</span><span class="font-mono">{{ configData.config.module?.redirects?.login }}</span>
378
- </div>
379
- <div class="config-row">
380
- <span class="config-label">Guest</span><span class="font-mono">{{ configData.config.module?.redirects?.guest }}</span>
381
- </div>
382
376
  <div class="config-row">
383
377
  <span class="config-label">DB</span><UBadge :color="configData.config.module?.databaseProvider === 'none' ? 'neutral' : 'success'" variant="subtle" size="sm">
384
378
  {{ configData.config.module?.databaseProvider === "nuxthub" ? "Hub" : "Off" }}
@@ -24,10 +24,6 @@ export interface BetterAuthModuleOptions {
24
24
  serverConfig?: string;
25
25
  /** Client config path relative to rootDir. Default: 'app/auth.config' */
26
26
  clientConfig?: string;
27
- redirects?: {
28
- login?: string;
29
- guest?: string;
30
- };
31
27
  /**
32
28
  * When redirecting unauthenticated users to the login route, append a query param
33
29
  * containing the originally requested path (for safe "return-to" redirects).
@@ -62,10 +58,6 @@ export interface BetterAuthModuleOptions {
62
58
  };
63
59
  }
64
60
  export interface AuthRuntimeConfig {
65
- redirects: {
66
- login: string;
67
- guest: string;
68
- };
69
61
  preserveRedirect: boolean;
70
62
  redirectQueryKey: string;
71
63
  useDatabase: boolean;
@@ -1,10 +1,6 @@
1
1
  declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<{
2
2
  config: {
3
3
  module: {
4
- redirects: {
5
- login?: string;
6
- guest?: string;
7
- };
8
4
  preserveRedirect: boolean;
9
5
  redirectQueryKey: string;
10
6
  secondaryStorage: boolean;
@@ -18,7 +18,6 @@ export default defineEventHandler(async (event) => {
18
18
  config: {
19
19
  // Module config (nuxt.config.ts)
20
20
  module: {
21
- redirects: publicAuth?.redirects || { login: "/login", guest: "/" },
22
21
  preserveRedirect: publicAuth?.preserveRedirect ?? true,
23
22
  redirectQueryKey: publicAuth?.redirectQueryKey ?? "redirect",
24
23
  secondaryStorage: privateAuth?.secondaryStorage ?? false,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@onmax/nuxt-better-auth",
3
3
  "type": "module",
4
- "version": "0.0.2-alpha.24",
4
+ "version": "0.0.2-alpha.25",
5
5
  "packageManager": "pnpm@10.15.1",
6
6
  "description": "Nuxt module for Better Auth integration with NuxtHub, route protection, session management, and role-based access",
7
7
  "author": "onmax",