adrien2p / medusa-plugins

A collection of awesome plugins for medusa :rocket:
https://medusa-plugins.vercel.app
MIT License
157 stars 46 forks source link

Error when sign in/sign up for a guest #114

Closed minhtungo closed 10 months ago

minhtungo commented 10 months ago

If a user has an order as a guest before, then signing in/signing up with Google (using the Gmail that they used in the Guest order), the response is customer already exists as a Guest.

Is this on purpose or any way to get around this so that if a Guest decides to sign up/sign in with Google, their user role on Medusa will switch from Guest to Registered?

Thank you.

adrien2p commented 10 months ago

I will think about it. But in theory the user should validate his account and then using strict none he could still use google after the account activation

tsvetann commented 10 months ago

I will think about it. But in theory the user should validate his account and then using strict none he could still use google after the account activation

I think this is related to my issue. I agree with @minhtungo that guest users should be allowed to create a new account when using google to login. This way this plugin will be aligned with how medusa core works

adrien2p commented 10 months ago

I ll tackle this asap guys, thanks for reporting it

adrien2p commented 10 months ago

so, @tsvetann the only thing to be aware of is that this error is thrown because there is no password provided when creating the customer which is expected for our use case cause the customer is logging in using an external provider, I can add a randomly generated password when calling the create method from the customer service. wdyt? then if the customer want to use the email/pass to login later, he will have to reset the password set his own password

minhtungo commented 10 months ago

so, @tsvetann the only thing to be aware of is that this error is thrown because there is no password provided when creating the customer which is expected for our use case cause the customer is logging in using an external provider, I can add a randomly generated password when calling the create method from the customer service. wdyt? then if the customer want to use the email/pass to login later, he will have to reset the password set his own password

I think that makes sense, tried it on the the Adidas site, I think they are doing the same approach, have to reset the password to use the email/pass login

tsvetann commented 10 months ago

Yeah let's try this

hampusboas commented 10 months ago

Is this related to not being able to login with an external auth provider if the user already exists in medusa with the same email address?

adrien2p commented 10 months ago

It is in some way when it is a guest. And both issues should be resolve with my currently open pr

adrien2p commented 10 months ago

I ve published a release if you can try guyrs 💪

adrien2p commented 10 months ago

closing for now