Skip to content

Conversation

fischi20
Copy link

UserSession type safety broke due to the Omit<> type not being able to handle Index Signatures.

This should get back the type safety to the setUserSession and replaceUserSession.

I did not check for other occurrences of this problem across the codebase because it was the only time It came up for me,
And the only time mentioned by the issue #433, I hope the position for the utility types is fine; otherwise, just let me know where to put them, and I will change that

@fischi20 fischi20 changed the title fix issue #433: UserSession type inference was broken fix issue #433: UserSession type safety was broken Sep 23, 2025
@atinux
Copy link
Owner

atinux commented Sep 24, 2025

Thank you @fischi20

Could you please fix the lint & test?

I think the file can be in src/runtime/types/utils.d.ts

@fischi20
Copy link
Author

fischi20 commented Sep 24, 2025

Hey, thank you for the feedback. I fixed lint errors and tests passed before too.
Sorry for forgetting about lints

I just wanted to ask, since I did not touch it, I don't mind leaving it there, but in the file src/runtime/server/utils/session.ts at line 115, the SessionConfig.cookie.sameSite type is stricter than the assigned string type. Should I add a @ts-expect with a small comment or just leave it?

Copy link

pkg-pr-new bot commented Oct 2, 2025

Open in StackBlitz

npm i https://pkg.pr.new/atinux/nuxt-auth-utils@459

commit: 663747a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants