hmellor / auction-website

An open-source auction hosting system
https://hmellor.github.io/auction-website/
MIT License
99 stars 47 forks source link

Email and password auth #76

Open robbrad opened 4 months ago

robbrad commented 4 months ago

What is needed to add email and password authentication

Issue I have found is it's possible to enter the same username again and it overwrites an existing account

hmellor commented 4 months ago

Issue I have found is it's possible to enter the same username again and it overwrites an existing account

This was actually intentional. It prevents a user from changing their display name and orphaning a bid they made with the old display name. i.e. bids are attached to UUIDs and the UUID is linked to whatever the user most recently set their display name to.

Originally, I didn't want email and password authentication because I didn't want to be handling personal information. But if you wanted to make a PR adding it as an option on the host side (i.e. the person hosting the website can choose which type of authentication they want to deploy, I'd accept that as a PR. I'd start here https://firebase.google.com/docs/auth/web/firebaseui

robbrad commented 4 months ago

I have managed it and made quite a lot of code changes to the solution

Unfortunately I didn't make it optional. 🤦‍♂️

I'll submit a PR but more for reference.

I'm not at all used to firebase or JavaScript unfortunately