nuxt-community / auth-module

Zero-boilerplate authentication support for Nuxt 2
https://auth.nuxtjs.org
MIT License
1.93k stars 924 forks source link

How to prevent auto load module interface / how to override built in interface #1800

Closed bagaskarala closed 11 months ago

bagaskarala commented 1 year ago

In this module, user props when accessed through this.$auth.user have this type get user(): Record<string, unknown> | null;. I want to change this, so user object is typed with my interface, let say interface User {name:string, phone: string}. Also i want to force that this user property is not nullable, so i want to use directly for example this.$auth.user.name without checking for null.

What i have been tried:

So, how to override built in interface from module? If not applicable, then how to disable load interface from module, so i can use custom interface on my own?

"@nuxtjs/auth-next": "5.0.0-1667386184.dfbbb54"

bagaskarala commented 11 months ago

solved by myself, see the solution here https://stackoverflow.com/questions/74806210/typescript-override-property-type-from-library-got-error-subsequent-property/74967869#74967869