Polak
Polak
NNuxt
Created by Polak on 11/14/2024 in #❓・help
Has anyone played around with "nuxt-auth-sanctum"? I have some issues.
Link to module: https://manchenkoff.gitbook.io/nuxt-auth-sanctum So where is my issue? I've managed to setup everything on Laravel 11 as for sanctum, but my issue is that my Nuxt app sends the GET /api/user request without the Application/json header. My question is, does anyone know how I can solve this? OR how else would you setup authentication with laravel 11 nowadays? I get this error from nuxt because the request doesnt have the right header:
[nuxt-auth-sanctum:ssr] ERROR Unable to load user identity from API [GET] "http://localhost:8000/api/user": <no response> fetch failed
[nuxt-auth-sanctum:ssr] ERROR Unable to load user identity from API [GET] "http://localhost:8000/api/user": <no response> fetch failed
If I call the same endpoint from Hoppscotch (postman) with the right header, then it works. I am looking for both tips, other recommendations to auth etc. I am fairly new to Nuxt and Laravel.
20 replies
NNuxt
Created by Polak on 11/11/2024 in #❓・help
(Solved) Nuxt with SASS - Legacy Deprecation
Hi. I am runnning into an issue while trying to use sass with Nuxt 3 project. I'm more of a do it yourself type of guy and therefore would like to use SASS. The sass package I use though, is throwing deprecation errors:
[3:37:33 PM] WARN Deprecation [legacy-js-api]: The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.
[3:37:33 PM] WARN Deprecation [legacy-js-api]: The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.
Does anyone know the solution to this? I have thought about saying f*ck it and use prepros to compile to css and just load that file, but then I loose the possibility to have scoped styling. Maybe I dont need a sass package at all? is it supported by default?
6 replies
NNuxt
Created by Polak on 6/7/2024 in #❓・help
i18n fallback issues
Heya people. I've recently moved away from NextJS over to Vue and I'm trying to setup the most important things and one of them is i18n. It works so smoothly compared to next and I love it so far. One thing I am not happy with though is the fallbackLocale feature on the i18n package. The documentation says I should do it in this way but the editor says it is wrong. Any ideas?
i18n: {
lazy: true,
langDir: "locales",
strategy: "prefix_and_default",
defaultLocale: "en",
fallbackLocale: ['en', 'fr'],
locales: [
{
code: "en",
iso: "en-US",
name: "English",
file: "en-US.json"
},
{
code: "da",
iso: "da-DK",
name: "Dansk",
file: "da-DK.json"
}
]
}
i18n: {
lazy: true,
langDir: "locales",
strategy: "prefix_and_default",
defaultLocale: "en",
fallbackLocale: ['en', 'fr'],
locales: [
{
code: "en",
iso: "en-US",
name: "English",
file: "en-US.json"
},
{
code: "da",
iso: "da-DK",
name: "Dansk",
file: "da-DK.json"
}
]
}
Documentation says I should it like this:
fallbackLocale: 'en',
fallbackLocale: 'en',
But I get the error:
Object literal may only specify known properties, and 'fallbackLocale' does not exist in type 'Partial<ModuleOptions>'.
Object literal may only specify known properties, and 'fallbackLocale' does not exist in type 'Partial<ModuleOptions>'.
^ On line with "fallbackLocale" Any suggestions? 😄
33 replies