dystcz / nuxt-sanctum-auth

Nuxt 3 + laravel sanctum authentication
134 stars 25 forks source link

$apiFetch #17

Closed TheSpecialist1 closed 1 year ago

TheSpecialist1 commented 1 year ago

Typescript is complaining about this ($apiFetch) being "unknown".

kreejzak commented 1 year ago

Hi, I'm not experiencing this issue. I fixed this in v0.4.2. Maybe try deleting cached types?

TheSpecialist1 commented 1 year ago

Okay I’ll try that. One more thing. When using the guest middlewire on the first page of my app (login page), there is a GET request made to the api endpoint to get the auth user and that’s before authenticating (logging in). I don’t know why would that be the case.

On Tue, Apr 25, 2023 at 5:00 AM Paul Cross @.***> wrote:

Hi, I'm not experiencing this issue. I fixed this in v0.4.2. Maybe try deletinch cached types?

— Reply to this email directly, view it on GitHub https://github.com/dystcz/nuxt-sanctum-auth/issues/17#issuecomment-1521429161, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALCCPGSRDMRKGT7Y3KV2TWDXC6HDTANCNFSM6AAAAAAXG7QBRE . You are receiving this because you authored the thread.Message ID: @.***>

kreejzak commented 1 year ago

The request is made to check if backend has stored session to log in user for example when they close and open the browser again. and also to check if frontend session is still valid.

TheSpecialist1 commented 1 year ago

Okay understood. Is there any way to get rid of the 404 error then?

On Tue, Apr 25, 2023 at 6:20 AM Paul Cross @.***> wrote:

The request is made to check if backend has stored session to log in user for example when they close and open the browser again. and also to check if frontend session is still valid.

— Reply to this email directly, view it on GitHub https://github.com/dystcz/nuxt-sanctum-auth/issues/17#issuecomment-1521540937, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALCCPGWS2RSTJ3TT44OANLTXC6QPDANCNFSM6AAAAAAXG7QBRE . You are receiving this because you authored the thread.Message ID: @.***>

kreejzak commented 1 year ago

it should be 401 and should only be a console error. does it redirect you to 404?

TheSpecialist1 commented 1 year ago

My bad - yes it’s a 401

On Tue, Apr 25, 2023 at 6:52 AM Paul Cross @.***> wrote:

it should be 401 and should only be a console error. does it redirect you to 404?

— Reply to this email directly, view it on GitHub https://github.com/dystcz/nuxt-sanctum-auth/issues/17#issuecomment-1521583634, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALCCPGU5JMMTTDH6ZQ2T56TXC6UHFANCNFSM6AAAAAAXG7QBRE . You are receiving this because you authored the thread.Message ID: @.***>

kreejzak commented 1 year ago

ok, I'm afraid there is no way to check if backend session exists withou a request. so no, the request is mandatory

TheSpecialist1 commented 1 year ago

Ok, thanks.

On Tue, Apr 25, 2023 at 6:59 AM Paul Cross @.***> wrote:

ok, I'm afraid there is no way to check if backend session exists withou a request. so no, the request is mandatory

— Reply to this email directly, view it on GitHub https://github.com/dystcz/nuxt-sanctum-auth/issues/17#issuecomment-1521592807, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALCCPGRAC5M6E7A6XBZAWNDXC6VBHANCNFSM6AAAAAAXG7QBRE . You are receiving this because you authored the thread.Message ID: @.***>

kreejzak commented 1 year ago

Hi, closing this issue, if you find anything new, please create new issue. Thanks