Skip to content

Custom authentification strategy #5251

Answered by pevey
olup asked this question in Q&A
Sep 29, 2023 · 3 comments · 10 replies
Discussion options

You must be logged in to vote

The service that handles auth requests is here: https://github.com/medusajs/medusa/blob/2b91049f58b2bd70cbee53e1ace7d36f59da6fa4/packages/medusa/src/services/auth.ts

The authenticate method handles user auth. (users in medusa means admin users, aka anything on the /admin routes). The authenticateCustomer method handles customer auth. (meaning, on the /store routes that require auth, which is not all of them)

These methods get invoked via middleware attached to the routes. These are here: https://github.com/medusajs/medusa/blob/2b91049f58b2bd70cbee53e1ace7d36f59da6fa4/packages/medusa/src/api/middlewares/authenticate-customer.ts
And here: https://github.com/medusajs/medusa/blob/2b91049f58b2…

Replies: 3 comments 10 replies

Comment options

You must be logged in to vote
9 replies
@olup
Comment options

@olup
Comment options

@pevey
Comment options

Answer selected by olup
@pevey
Comment options

@olup
Comment options

@pevey
Comment options

@olup
Comment options

Comment options

You must be logged in to vote
1 reply
@lukethegeek
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants