DEV Community

Discussion on: Laravel Api authentication (Sanctum) with NuxtJs(Part-2)

Collapse
 
tanzimibthesam profile image
Tanzim Ibthesam • Edited

Are you facing the problem in postman? Did you write the register route properly?

Collapse
 
musawershah1598 profile image
Musawer Shah

No in postman it is working fine but in nuxt app it is causing problems on register route or simply any post request. Btw i had found a workaround don't know if it is correct or not. Here it is.



this.$axios.get("sanctum/csrf-cookie").then(()=>{
   // then after doing post request here it works.
})
Enter fullscreen mode Exit fullscreen mode
Thread Thread
 
tanzimibthesam profile image
Tanzim Ibthesam

Ok didnt face such issues anyways thanks will note it for future reference

Collapse
 
iamazizmohmdi profile image
Aziz Mohammadi

Request failed with status code 419:
I got this error for login and register.
How to solve this?
I think it is because of csrf
I don't know how to do this.
for every post request I face with this error.

Thread Thread
 
tanzimibthesam profile image
Tanzim Ibthesam

Read the above comment the solution is provided there Thanks

Thread Thread
 
sergiodanilojr profile image
Sérgio Danilo Jr

You need to check the file config/sanctum.php, and see the index 'domains'... There you need to write the yours.