Denoder / nuxt-module-alternatives

Alternative modules to use while waiting for Nuxt 3 Compatibility
MIT License
144 stars 14 forks source link

Example of TypeScript #82

Closed steklopod closed 2 years ago

steklopod commented 2 years ago

Hi guys. Thank you for your work. I'm currently moving from nuxt 2 to nuxt 3 and I found your library. I am new at nuxt 3 and can't realize how to configure nuxtjs-alt/auth.

Comunity will be happier if you provide any link with example.

I tried something like this, but it obviously is not working solution:

Снимок экрана 2022-09-23 в 20 49 56 Снимок экрана 2022-09-23 в 20 50 13

I am backender, so pls, don't be angry if it is stupid question

Denoder commented 2 years ago

You have to get $auth from useNuxtApp.

steklopod commented 2 years ago

Thank you for quick reply. I tried this, but it seems not to be typed. There are no suggestions from IDE:

Снимок экрана 2022-09-24 в 11 49 51

For example, in nuxt 2 project I have suggestions:

Снимок экрана 2022-09-24 в 11 52 30

Here is related topic: https://github.com/nuxt-community/auth-module/issues/1097

Denoder commented 2 years ago

I've updated the package, try to see if that works for you, if not, also try using const auth = useAuth()

steklopod commented 2 years ago

Wow! Thanks a lot! Now all suggestions are in place!

Снимок экрана 2022-09-25 в 14 31 29