chec / commercejs-nextjs-demo-store

Commerce demo store built for the Jamstack. Built with Commerce.js, Next.js, and can be one-click deployed to Netlify. Includes product catalog, customer login, categories, variants, cart, checkout, payments (Stripe) order confirmation, and printable receipts.
https://commercejs-demo-store.netlify.app/
BSD 3-Clause "New" or "Revised" License
1.07k stars 206 forks source link

[CHEC-1008] Feature/auth login handler #145

Closed jaepass closed 3 years ago

jaepass commented 3 years ago
linear[bot] commented 3 years ago
CHEC-1008 Build login handler to handle email login links

When the user enters their email to log in, they will get an email sent to them. This email will contain a link back to the demo store URL. This page will need to accept a request which contains a token in the URL, and will need to make a request to Chec to exchange the token for a JWT: ``` POST /v1/customers/exchange-token token={token_from_url} ``` This API returns a JSON web token which authorizes the customer for 24 hours. Ideally we also do an API call to fetch the user's data ( `GET /v1/customers/{customer_id}` ) at this point, and we can store that locally too. After login, we can redirect the user to their "customer home" page which is built in another task.

jaepass commented 3 years ago

thanks for your help guys!