@@ -2,6 +2,7 @@ import type { H3Event, SessionConfig } from 'h3'
22import { useSession , createError , isEvent } from 'h3'
33import { defu } from 'defu'
44import { createHooks } from 'hookable'
5+ import type { OmitWithIndexSignature } from '../../types/utils'
56import { useRuntimeConfig } from '#imports'
67import type { UserSession , UserSessionRequired } from '#auth-utils'
78
@@ -40,7 +41,7 @@ export async function getUserSession(event: UseSessionEvent): Promise<UserSessio
4041 * @param data User session data, please only store public information since it can be decoded with API calls
4142 * @see https://github.com/atinux/nuxt-auth-utils
4243 */
43- export async function setUserSession ( event : H3Event , data : Omit < UserSession , 'id' > , config ?: Partial < SessionConfig > ) : Promise < UserSession > {
44+ export async function setUserSession ( event : H3Event , data : OmitWithIndexSignature < UserSession , 'id' > , config ?: Partial < SessionConfig > ) : Promise < UserSession > {
4445 const session = await _useSession ( event , config )
4546
4647 await session . update ( defu ( data , session . data ) )
@@ -53,7 +54,7 @@ export async function setUserSession(event: H3Event, data: Omit<UserSession, 'id
5354 * @param event The Request (h3) event
5455 * @param data User session data, please only store public information since it can be decoded with API calls
5556 */
56- export async function replaceUserSession ( event : H3Event , data : Omit < UserSession , 'id' > , config ?: Partial < SessionConfig > ) : Promise < UserSession > {
57+ export async function replaceUserSession ( event : H3Event , data : OmitWithIndexSignature < UserSession , 'id' > , config ?: Partial < SessionConfig > ) : Promise < UserSession > {
5758 const session = await _useSession ( event , config )
5859
5960 await session . clear ( )
0 commit comments