dystcz / nuxt-sanctum-auth

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

handle errors on login #18

Open betsaleel777 opened 1 year ago

betsaleel777 commented 1 year ago

async function onSubmit(values: any) { try { await $sanctumAuth.login(values, (data) => { navigateTo("/"); console.log(data); }); } catch (error) { const fail = error as FetchError; console.log(fail); } } I can't handle errors or recover from them, console.log() do not work, that display nothing

kreejzak commented 1 year ago

Hi, I will look at this in few days. Thanks for your patiance.

rambii commented 1 year ago

Just ran a quick test of the snippet @betsaleel777 (without the TS type definitions)posted. It works for me and prints the error like it's supposed to.

kreejzak commented 1 year ago

Hi, right now I'm working on major rewrite that will include better error handling alongside better type support. Stay tuned

image

YoungMayor commented 1 year ago

Hello, I was wondering if there was an ETA on the next major release.

I really appreciate this package Thanks

kreejzak commented 1 year ago

Hello, still in progress. Unfortunately I have less time than anticipated. Will try to push it faster.