Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: UserSession secure type augmentation #181

Merged
merged 2 commits into from
Sep 19, 2024
Merged

Conversation

IsraelOrtuno
Copy link
Contributor

@IsraelOrtuno IsraelOrtuno commented Sep 16, 2024

Seems like secure type (https://github.com/atinux/nuxt-auth-utils/blob/main/src/runtime/types/session.ts#L14) can't be augmented just like in #54. This PR extracts the secure property type to a separated interface SecureSessionData that allows augmentation/overriding the default typings.

This would allow to add better typing to the secure property:

// auth.d.ts
declare module '#auth-utils' {
  interface SecureSessionData {
    token: string
  }
}

export {}

@atinux atinux merged commit 125ea11 into atinux:main Sep 19, 2024
@atinux
Copy link
Owner

atinux commented Sep 19, 2024

Thank you, and you updated the readme too ❤️

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