@witchcraft/nuxt-auth 0.1.4 → 0.1.5

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": "auth",
3
3
  "configKey": "auth",
4
- "version": "0.1.3",
4
+ "version": "0.1.5",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
package/dist/module.mjs CHANGED
@@ -3,7 +3,7 @@ import { defineNuxtModule, useLogger, createResolver, addComponentsDir, addImpor
3
3
  import { defu } from 'defu';
4
4
 
5
5
  const dependencies = {
6
- "@witchcraft/ui": "^0.3.0",
6
+ "@witchcraft/ui": "^0.3.2",
7
7
  "nuxt-security": "^2.4.0"};
8
8
  const pkg = {
9
9
  dependencies: dependencies};
@@ -1,5 +1,5 @@
1
- import { useAuth } from "../composables/useAuth.js.js";
2
- import type { ProviderNames, ProviderStyle, UseAuthComposableOptions } from "../types.js.js";
1
+ import { useAuth } from "../composables/useAuth.js";
2
+ import type { ProviderNames, ProviderStyle, UseAuthComposableOptions } from "../types.js";
3
3
  type __VLS_Props = {
4
4
  providerStyles?: Record<ProviderNames, Partial<ProviderStyle>>;
5
5
  useAuthOptions?: UseAuthComposableOptions;
@@ -1,5 +1,5 @@
1
- import { useAuth } from "../composables/useAuth.js.js";
2
- import type { ProviderNames, ProviderStyle, UseAuthComposableOptions } from "../types.js.js";
1
+ import { useAuth } from "../composables/useAuth.js";
2
+ import type { ProviderNames, ProviderStyle, UseAuthComposableOptions } from "../types.js";
3
3
  type __VLS_Props = {
4
4
  providerStyles?: Record<ProviderNames, Partial<ProviderStyle>>;
5
5
  useAuthOptions?: UseAuthComposableOptions;
@@ -1,4 +1,4 @@
1
- import type { AuthUser } from "../types.js.js";
1
+ import type { AuthUser } from "../types.js";
2
2
  type __VLS_Props = {
3
3
  /** The link to the user's profile. Links to `/users/:username` (note this is not provided by the module). */
4
4
  usernameLink?: (user: AuthUser) => string;
@@ -1,4 +1,4 @@
1
- import type { AuthUser } from "../types.js.js";
1
+ import type { AuthUser } from "../types.js";
2
2
  type __VLS_Props = {
3
3
  /** The link to the user's profile. Links to `/users/:username` (note this is not provided by the module). */
4
4
  usernameLink?: (user: AuthUser) => string;
@@ -1,2 +1,2 @@
1
- import type { ProviderStyle } from "../types.js.js";
1
+ import type { ProviderStyle } from "../types.js";
2
2
  export declare const providerStyles: Record<string, ProviderStyle>;
@@ -56,7 +56,7 @@ export interface GithubUser {
56
56
  [k: string]: unknown;
57
57
  }
58
58
  import { GitHub, type OAuth2Tokens } from "arctic";
59
- import type { ProviderHandler, ProviderHandlerOptions, ProviderOptions } from "../../types.js";
59
+ import type { ProviderHandler, ProviderHandlerOptions, ProviderOptions } from "../../types";
60
60
  export default class GithubProvider implements ProviderHandler<"oauth2", "github", GitHub> {
61
61
  name: "github";
62
62
  type: "oauth2";
@@ -1,5 +1,5 @@
1
1
  import { Google, type OAuth2Tokens } from "arctic";
2
- import type { ProviderHandler, ProviderHandlerOptions, ProviderOptions } from "../../types.js";
2
+ import type { ProviderHandler, ProviderHandlerOptions, ProviderOptions } from "../../types";
3
3
  declare module "../../types.js" {
4
4
  interface InternalProviders {
5
5
  google: GoogleUser;
@@ -6,9 +6,9 @@ import type { EventHandler, H3Event, Router } from "h3";
6
6
  import type { JwtPayload } from "jsonwebtoken";
7
7
  import type { RuntimeConfig } from "nuxt/schema";
8
8
  import { z } from "zod";
9
- import type { AuthAccountsTable, UserTable } from "./createAuthSchema.js.js";
10
- import type { SessionManager } from "./SessionManager.js.js";
11
- import type { AuthOptions, AuthSession, AuthUser, BaseProviderAccountInfo, ProviderHandler, ProviderNames } from "../../types.js";
9
+ import type { AuthAccountsTable, UserTable } from "./createAuthSchema.js";
10
+ import type { SessionManager } from "./SessionManager.js";
11
+ import type { AuthOptions, AuthSession, AuthUser, BaseProviderAccountInfo, ProviderHandler, ProviderNames } from "../../types";
12
12
  export declare const zState: z.ZodObject<{
13
13
  oauthState: z.ZodString;
14
14
  additionalState: z.ZodAny;
@@ -1,8 +1,8 @@
1
1
  import type { DeepPartial } from "@alanscodelog/utils";
2
2
  import type { PgDatabase } from "drizzle-orm/pg-core";
3
3
  import type { RuntimeConfig } from "nuxt/schema";
4
- import type { AuthSessionsTable, AuthUsersTable } from "./createAuthSchema.js.js";
5
- import type { AuthSession, SessionCookie, SessionCookieOptions, SessionValidationResult } from "../../types.js.js";
4
+ import type { AuthSessionsTable, AuthUsersTable } from "./createAuthSchema.js";
5
+ import type { AuthSession, SessionCookie, SessionCookieOptions, SessionValidationResult } from "../../types.js";
6
6
  export declare const defaultSessionCookieName = "authSession";
7
7
  export declare class SessionManager {
8
8
  options: {
@@ -2,7 +2,7 @@ import type { BaseLogger } from "@witchcraft/nuxt-logger/createUseLogger";
2
2
  import type { PgDatabase } from "drizzle-orm/pg-core";
3
3
  import type { EventHandler } from "h3";
4
4
  import type { RuntimeConfig } from "nuxt/schema";
5
- import type { AuthAccountsTable, UserTable } from "./createAuthSchema.js.js";
6
- import type { SessionManager } from "./SessionManager.js.js";
7
- import type { AuthHandlerOptions } from "../../types.js.js";
5
+ import type { AuthAccountsTable, UserTable } from "./createAuthSchema.js";
6
+ import type { SessionManager } from "./SessionManager.js";
7
+ import type { AuthHandlerOptions } from "../../types.js";
8
8
  export declare function createAuthHandler(rc: RuntimeConfig, db: PgDatabase<any, any, any>, usersTable: UserTable, authAccountsTable: AuthAccountsTable, sessionManager: SessionManager, logger: BaseLogger, opts?: Partial<AuthHandlerOptions>): EventHandler;
@@ -1,6 +1,6 @@
1
1
  import type { BaseLogger } from "@witchcraft/nuxt-logger/createUseLogger";
2
- import type { SessionManager } from "./SessionManager.js.js";
3
- import type { AuthSession, AuthUser } from "../../types.js.js";
2
+ import type { SessionManager } from "./SessionManager.js";
3
+ import type { AuthSession, AuthUser } from "../../types.js";
4
4
  export declare function createAuthMiddleware(sessionManager: SessionManager, logger: BaseLogger): any;
5
5
  declare module "h3" {
6
6
  interface H3EventContext {
@@ -4,10 +4,10 @@ import type { H3Event, Router } from "h3";
4
4
  import type { StringValue } from "ms";
5
5
  import type { InjectionKey } from "vue";
6
6
  import { z } from "zod";
7
- import "./core/providers/github.js.js";
8
- import "./core/providers/google.js.js";
9
- import type { AuthAccount, AuthSession as DbAuthSession, AuthUserFields as DbAuthUser } from "./server/utils/createAuthSchema.js.js";
10
- import type { ModulePublicRuntimeConfig } from "../module.js.js";
7
+ import "./core/providers/github.js";
8
+ import "./core/providers/google.js";
9
+ import type { AuthAccount, AuthSession as DbAuthSession, AuthUserFields as DbAuthUser } from "./server/utils/createAuthSchema.js";
10
+ import type { ModulePublicRuntimeConfig } from "../module.js";
11
11
  export type * from "./server/utils/createAuthSchema.js";
12
12
  /**
13
13
  * This is the minimum information providers need to return.
@@ -120,7 +120,7 @@ export type ProviderOptions<TProviderName extends ProviderNames = ProviderNames,
120
120
  *
121
121
  * You can type the return by declaration merging with the `AuthExtendedUserInfo` interface.
122
122
  *
123
- * This is set only once per provider account creation and can the info column can just be cleared after the information is no longer needed.
123
+ * This is set only once per provider account creation and the info column can just be cleared after the information is no longer needed.
124
124
  */
125
125
  getAdditionalAccountInfo?: (user: TProviderAccountInfo) => Promise<AdditionalAccountInfo>;
126
126
  };
@@ -1,3 +1,3 @@
1
1
  import type { PublicRuntimeConfig } from "@nuxt/schema";
2
- import type { ApiRoutesParams } from "../../module.js.js";
2
+ import type { ApiRoutesParams } from "../../module.js";
3
3
  export declare function getAuthApiRoute<T extends keyof PublicRuntimeConfig["auth"]["authApiRoutes"], TParams extends T extends keyof ApiRoutesParams ? ApiRoutesParams[T] : never>(rc: PublicRuntimeConfig, route: T, params?: TParams, queryParams?: Record<string, any>): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@witchcraft/nuxt-auth",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Nuxt module for logging.",
5
5
  "repository": "witchcraftjs/nuxt-auth",
6
6
  "license": "MIT",
@@ -24,7 +24,7 @@
24
24
  "dist"
25
25
  ],
26
26
  "scripts": {
27
- "prepare": "husky && cd playground && pnpm i",
27
+ "prepare": "husky && pnpm nuxt-module-build prepare && pnpm build:only && cd playground && pnpm i --ignore-scripts --ignore-workspace",
28
28
  "build": "cross-env-shell DISABLE_POSTGRES_ENSURE_ENV=true 'nuxt-module-build prepare && nuxt-module-build build && pnpm nuxi build playground'",
29
29
  "build:only": "nuxt-module-build build",
30
30
  "//": "drizzle requires we run from playground",
@@ -52,7 +52,7 @@
52
52
  "@oslojs/encoding": "^1.1.0",
53
53
  "@vueuse/core": "^13.9.0",
54
54
  "@witchcraft/nuxt-logger": "^0.0.2",
55
- "@witchcraft/ui": "^0.3.0",
55
+ "@witchcraft/ui": "^0.3.2",
56
56
  "arctic": "~3.7.0",
57
57
  "cookie-es": "^2.0.0",
58
58
  "defu": "latest",