nuxt-auth-utils 0.5.30 → 0.5.31

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-utils",
3
3
  "configKey": "auth",
4
- "version": "0.5.30",
4
+ "version": "0.5.31",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -1,8 +1,8 @@
1
1
  import type { H3Event, SessionConfig } from 'h3';
2
2
  import { useSession } from 'h3';
3
3
  import type { OmitWithIndexSignature } from '../../types/utils.js';
4
- import type { UserSession, UserSessionRequired } from '#auth-utils';
5
- type UseSessionEvent = Parameters<typeof useSession>[0];
4
+ import type { SessionEvent, UserSession, UserSessionRequired } from '#auth-utils';
5
+ type UseSessionEvent = Parameters<typeof useSession>[0] | SessionEvent;
6
6
  export interface SessionHooks {
7
7
  /**
8
8
  * Called when fetching the session from the API
@@ -28,19 +28,19 @@ export declare function getUserSession(event: UseSessionEvent): Promise<UserSess
28
28
  * @param data User session data, please only store public information since it can be decoded with API calls
29
29
  * @see https://github.com/atinux/nuxt-auth-utils
30
30
  */
31
- export declare function setUserSession(event: H3Event, data: OmitWithIndexSignature<UserSession, 'id'>, config?: Partial<SessionConfig>): Promise<UserSession>;
31
+ export declare function setUserSession(event: SessionEvent, data: OmitWithIndexSignature<UserSession, 'id'>, config?: Partial<SessionConfig>): Promise<UserSession>;
32
32
  /**
33
33
  * Replace a user session
34
34
  * @param event The Request (h3) event
35
35
  * @param data User session data, please only store public information since it can be decoded with API calls
36
36
  */
37
- export declare function replaceUserSession(event: H3Event, data: OmitWithIndexSignature<UserSession, 'id'>, config?: Partial<SessionConfig>): Promise<UserSession>;
37
+ export declare function replaceUserSession(event: SessionEvent, data: OmitWithIndexSignature<UserSession, 'id'>, config?: Partial<SessionConfig>): Promise<UserSession>;
38
38
  /**
39
39
  * Clear the user session and removing the session cookie
40
40
  * @param event The Request (h3) event
41
41
  * @returns true if the session was cleared
42
42
  */
43
- export declare function clearUserSession(event: H3Event, config?: Partial<SessionConfig>): Promise<boolean>;
43
+ export declare function clearUserSession(event: SessionEvent, config?: Partial<SessionConfig>): Promise<boolean>;
44
44
  /**
45
45
  * Require a user session, throw a 401 error if the user is not logged in
46
46
  * @param event
@@ -0,0 +1,4 @@
1
+ import type { H3Event } from 'h3';
2
+ import type { RequestEvent } from '@nuxt/schema';
3
+ export type { RequestEvent };
4
+ export type SessionEvent = H3Event | RequestEvent;
File without changes
@@ -1,3 +1,4 @@
1
1
  export type { User, UserSession, UserSessionRequired, UserSessionComposable, SecureSessionData } from './session.js';
2
+ export type { RequestEvent, SessionEvent } from './event.js';
2
3
  export type { OAuthConfig, OAuthProvider, ATProtoProvider, OnError } from './oauth-config.js';
3
4
  export type { WebAuthnCredential, WebAuthnRegisterEventHandlerOptions, WebAuthnAuthenticateEventHandlerOptions, WebAuthnComposable, WebAuthnUser, } from './webauthn.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-auth-utils",
3
- "version": "0.5.30",
3
+ "version": "0.5.31",
4
4
  "description": "Add Authentication to Nuxt applications with secured & sealed cookies sessions.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -41,6 +41,7 @@
41
41
  "dependencies": {
42
42
  "@adonisjs/hash": "^9.1.1",
43
43
  "@nuxt/kit": "^4.3.1",
44
+ "@nuxt/schema": "^4.6.0",
44
45
  "defu": "^6.1.4",
45
46
  "h3": "^1.15.4",
46
47
  "hookable": "^6.0.1",
@@ -76,14 +77,13 @@
76
77
  "@nuxt/devtools": "3.2.1",
77
78
  "@nuxt/eslint-config": "^1.15.1",
78
79
  "@nuxt/module-builder": "^1.0.2",
79
- "@nuxt/schema": "^4.3.1",
80
80
  "@nuxt/test-utils": "^4.0.0",
81
- "@types/node": "latest",
82
81
  "@nuxt/ui": "^4.4.0",
83
82
  "@simplewebauthn/types": "^12.0.0",
83
+ "@types/node": "latest",
84
84
  "changelogen": "^0.6.2",
85
85
  "eslint": "^10.0.0",
86
- "nuxt": "^4.3.1",
86
+ "nuxt": "^4.6.0",
87
87
  "typescript": "5.9.3",
88
88
  "vitest": "^4.0.18",
89
89
  "vue-tsc": "^3.2.4"