851 viewsNext Amazona

 <button
onClick={() => router.push(‘login?redirect=/shipping’)}
className=’primary-button w-full’>

this code from cart.js

Bassir Answered question October 13, 2022

if user is already logged in we redirect them to redirect value in query string:

https://github.com/basir/next-tailwind-amazona/blob/main/pages/login.js#L17

otherwise show login form.

Bassir Answered question October 13, 2022