vendure-ecommerce / vendure

The commerce platform with customization in its DNA.
https://www.vendure.io
Other
5.76k stars 1.02k forks source link

Create implicit Customer for each Administrator #190

Closed michaelbromley closed 4 months ago

michaelbromley commented 5 years ago

Is your feature request related to a problem? Please describe. If logged in as an Administrator, then the activeCustomer query will return a "fake" Customer entity with an invalid ID. In general, using the Shop API when logged in as an Administrator results in buggy behaviour.

Describe the solution you'd like When an Administrator is created, a corresponding Customer should also be created pointing to the same User. This will allow the Shop API to behave correctly even when logged in as an Administrator.

Szbuli commented 4 years ago

The current fake Customer will map to a real customer (the first customer will get id '1').

What is the reason behind the need of customer for an administrator. I would not let any administrator to use the webshop.

michaelbromley commented 4 years ago

For me this comes up quite frequently in development. I am logged into the Admin UI, and in the same browser I visit my storefront, and appear to be logged in as a Customer due to the existing auth cookie. I instead need to then visit my storefront in a different browser / private tab.

The issue is that it's more of an annoyance and probable source of confusion/frustration to other developers.

martijnvdbrug commented 4 months ago

Can not reproduce: