@witchcraft/nuxt-auth 0.1.4 → 0.1.6

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.6",
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,16 +1,29 @@
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;
6
6
  loginOptions?: Parameters<ReturnType<typeof useAuth>["login"]>[1];
7
7
  };
8
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
8
+ declare var __VLS_19: {
9
+ iconClass: string;
10
+ class: string;
11
+ };
12
+ type __VLS_Slots = {} & {
13
+ extra?: (props: typeof __VLS_19) => any;
14
+ };
15
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
9
16
  providerStyles: Record<ProviderNames, Partial<ProviderStyle>>;
10
17
  useAuthOptions: UseAuthComposableOptions;
11
18
  loginOptions: {
12
19
  devBypass?: boolean;
13
20
  };
14
21
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
22
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
15
23
  declare const _default: typeof __VLS_export;
16
24
  export default _default;
25
+ type __VLS_WithSlots<T, S> = T & {
26
+ new (): {
27
+ $slots: S;
28
+ };
29
+ };
@@ -35,6 +35,11 @@
35
35
  Sign in / Register with {{ styles[provider]?.name ?? provider }}
36
36
  </WButton>
37
37
  </template>
38
+ <slot
39
+ name="extra"
40
+ class="p-2 text-l"
41
+ icon-class="text-xl px-2"
42
+ />
38
43
  </div>
39
44
  </template>
40
45
 
@@ -1,16 +1,29 @@
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;
6
6
  loginOptions?: Parameters<ReturnType<typeof useAuth>["login"]>[1];
7
7
  };
8
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
8
+ declare var __VLS_19: {
9
+ iconClass: string;
10
+ class: string;
11
+ };
12
+ type __VLS_Slots = {} & {
13
+ extra?: (props: typeof __VLS_19) => any;
14
+ };
15
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
9
16
  providerStyles: Record<ProviderNames, Partial<ProviderStyle>>;
10
17
  useAuthOptions: UseAuthComposableOptions;
11
18
  loginOptions: {
12
19
  devBypass?: boolean;
13
20
  };
14
21
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
22
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
15
23
  declare const _default: typeof __VLS_export;
16
24
  export default _default;
25
+ type __VLS_WithSlots<T, S> = T & {
26
+ new (): {
27
+ $slots: S;
28
+ };
29
+ };
@@ -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";
@@ -79,7 +79,7 @@ export default class GithubProvider implements ProviderHandler<"oauth2", "github
79
79
  }
80
80
  export declare const githubProviderStyle: {
81
81
  name: string;
82
- logo: import("vue").FunctionalComponent<import("vue").SVGAttributes, {}, any, {}>;
82
+ logo: any;
83
83
  style: {
84
84
  bg: string;
85
85
  bgDark: string;
@@ -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;
@@ -60,7 +60,7 @@ export default class GoogleProvider implements ProviderHandler<"oauth2_pcke", "g
60
60
  }
61
61
  export declare const googleProviderStyle: {
62
62
  name: string;
63
- logo: import("vue").FunctionalComponent<import("vue").SVGAttributes, {}, any, {}>;
63
+ logo: any;
64
64
  style: {
65
65
  bg: string;
66
66
  bgDark: string;
@@ -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.6",
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",