stacker.news/pages
SatsAllDay 15f9950477
Store hashed and salted email addresses (#1111)
* first pass of hashing user emails

* use salt

* add a salt to .env.development (prod salt needs to be kept a secret)
* move `hashEmail` util to a new util module

* trigger a one-time job to migrate existing emails via the worker

so we can use the salt from an env var

* move newsletter signup

move newsletter signup to prisma adapter create user with email code path
so we can still auto-enroll email accounts without having to persist the email address
in plaintext

* remove `email` from api key session lookup query

* drop user email index before dropping column

* restore email column, just null values instead

* fix function name

* fix salt and hash raw sql statement

* update auth methods email type in typedefs from str to bool

* remove todo comment

* lowercase email before hashing during migration

* check for emailHash and email to accommodate migration window

update our lookups to check for a matching emailHash, and then a matching
email, in that order, to accommodate the case that a user tries to login
via email while the migration is running, and their account has not yet been migrated

also update sndev to have a command `./sndev email` to launch the mailhog inbox in your browser

also update `./sndev login` to hash the generated email address and insert it into the db record

* update sndev help

* update awards.csv

* update the hack in next-auth to re-use the email supplied on input to `getUserByEmail`

* consolidate console.error logs

* create generic open command

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
2024-05-04 18:06:15 -05:00
..
[name] Add Footer to User Page (#1135) 2024-05-03 16:55:07 -05:00
api Store hashed and salted email addresses (#1111) 2024-05-04 18:06:15 -05:00
auth Use module path aliases (#938) 2024-03-19 19:37:31 -05:00
invites Merge serializeInvoiceable with serialize without bug (#1051) 2024-04-09 19:49:20 -05:00
invoices adjust qr skeleton for bolt11info 2024-04-16 16:20:13 -05:00
items/[id] enhance navigation 2024-03-26 18:36:31 -05:00
referrals add NEXT_PUBLIC_URL 2024-04-08 17:54:39 -05:00
rewards reintroduce daily rewards (#1134) 2024-05-01 09:30:36 -05:00
satistics fix #1132 broken satistics links 2024-04-30 17:52:34 -05:00
settings Store hashed and salted email addresses (#1111) 2024-05-04 18:06:15 -05:00
stackers chart skeletons 2024-03-25 15:35:32 -04:00
wallet add lnc attached wallet (#1104) 2024-04-26 21:22:30 -05:00
withdrawals Show preimage of confirmed withdrawals (#1106) 2024-04-25 19:33:24 -05:00
~ reintroduce daily rewards (#1134) 2024-05-01 09:30:36 -05:00
404.js upgrade to next-auth 4 (bonus: improve error pages) 2023-07-29 14:38:20 -05:00
500.js upgrade to next-auth 4 (bonus: improve error pages) 2023-07-29 14:38:20 -05:00
_app.js fix safari bottom inset problem 2024-03-28 15:00:23 -05:00
_document.js enhance navigation 2024-03-26 18:36:31 -05:00
_error.js Use module path aliases (#938) 2024-03-19 19:37:31 -05:00
email.js Use module path aliases (#938) 2024-03-19 19:37:31 -05:00
live.js Use module path aliases (#938) 2024-03-19 19:37:31 -05:00
login.js add NEXT_PUBLIC_URL 2024-04-08 17:54:39 -05:00
notifications.js Use module path aliases (#938) 2024-03-19 19:37:31 -05:00
offline.js Use module path aliases (#938) 2024-03-19 19:37:31 -05:00
search.js search all territories by default + more intuitive search filters 2024-03-26 18:37:40 -05:00
share.js Service worker rework, Web Target Share API & Web Push API (#324) 2023-07-04 14:36:07 -05:00
signup.js enhance navigation 2024-03-26 18:36:31 -05:00
territory.js Use module path aliases (#938) 2024-03-19 19:37:31 -05:00