How can I identify a logged-in user on the storefront using storefront session in app?

Shopify Partner
2 0 0

I have the following scenario: I have a service for which you can register via oidc. Certain users receive discounts on certain products in the store (these can be thought of as vouchers that can be used once).
My plan is now as follows:
1. create a theme extension. This has the task of directing the user to the login and as soon as he is logged in, the login button is replaced by a modal where the desired voucher can be selected.
2. an admin app (embedded) to manage the vouchers
3. a backend that receives the requests from the admin app and manages vouchers, but also manages the requests via the storefront and regulates the login via the OIDC provider.

Now I have the following problem: I use shopify-express for the backend, which also works wonderfully for the Admin App - because App Bridge.
I don't have this option on the storefront and creating a session with Passport is out of the question due to cross-origin cookies. So how can I identify the user who is currently on the storefront and has logged in?

Replies 0 (0)