dystcz / nuxt-sanctum-auth

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

Set an 'intended' url to redirect user after the login #35

Closed EdnaldoNeimeg closed 1 year ago

EdnaldoNeimeg commented 1 year ago

Is there any way to change /home in runtime?

I'm building an ecommerce app and when the user try to go to payment page I need to ensure the user is authenticated, i do it by using the 'auth' middleware in 'payment' page and, if not authenticated, the user is redirected to login. Everything works perfectly, bu I have to redirect the user back to payment page after the login.

Is there a way to set an "intended" url?

EdnaldoNeimeg commented 1 year ago

Nevermind.

It works out of the box.

I was using an callback to ALWAYS redirect to '/'. That's why the native redirect wasn't working.