iDempiere-micro / erpjs

erpjs - open source serverless headless ERP&CRM in JavaScript/TypeScript
https://eolerp.eu/
MIT License
94 stars 27 forks source link

switching to user.sub + making sure we do not fail creating user because of multiple requests #164

Closed davidpodhola closed 10 months ago

davidpodhola commented 10 months ago

TL;DR

There was an annoying bug when users would fail to log in just after they were created. Also, we always required users to have an email.

Proof

Just try.

Merge request checklist

Please check if your merge request fulfills the following requirements:

Merge request type

Before this merge request

The requests were coming at the same time and since the code is async, the commit would fail.

How you fixed what was wrong

Start using sub instead of email (that allows users without emails to get in). Added a lock to allow user creation to finish.