stacker.news/lib
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
..
apollo.js add TypePolicy to Fact (#1138) 2024-05-03 14:35:16 -05:00
badge.js check both `navigator.permissions.query` and `Notification.permission` for permissions (#655) 2023-11-25 11:32:41 -06:00
bip39-words.js add lnc attached wallet (#1104) 2024-04-26 21:22:30 -05:00
bolt11.js add lnc attached wallet (#1104) 2024-04-26 21:22:30 -05:00
clicks.js Revert "Revert "shield your eyes; massive, squashed refactor; nextjs/react/react-dom/apollo upgrades"" 2023-07-23 10:08:43 -05:00
cln.js Use proxy agents for CLNRest over Tor (#1136) 2024-05-03 17:00:28 -05:00
constants.js Allow deletion of wallet logs (#1101) 2024-05-03 14:14:33 -05:00
crypto.js Store hashed and salted email addresses (#1111) 2024-05-04 18:06:15 -05:00
currency.js reuse validation on server 2023-02-08 13:39:53 -06:00
cursor.js use keyset pagination for notifications (#899) 2024-03-06 13:53:13 -06:00
fancy-names.json Add setting to send diagnostics back to SN (#463) 2023-09-18 18:00:16 -05:00
form.js introduce `persistOnNavigate` option for toasts (#1095) 2024-04-21 17:25:48 -05:00
format.js handle other possible base64-like string encodings 2024-02-18 15:08:55 -06:00
item.js improved comment linking 2024-01-17 19:03:49 -06:00
lnurl.js add NEXT_PUBLIC_URL 2024-04-08 17:54:39 -05:00
macaroon-id.js LND autowithdraw (#806) 2024-02-13 13:17:56 -06:00
macaroon-id.proto LND autowithdraw (#806) 2024-02-13 13:17:56 -06:00
macaroon.js handle other possible base64-like string encodings 2024-02-18 15:08:55 -06:00
madness.js reintroduce daily rewards (#1134) 2024-05-01 09:30:36 -05:00
md.js remove debug loggin for rehype plugin 2023-10-23 18:16:06 -05:00
new-comments.js subtle highlight of new comments 2023-08-06 14:18:40 -05:00
nostr.js Nostr crossposting all item types (#779) 2024-02-21 19:18:36 -06:00
package.json Convert worker to ESM (#500) 2023-09-23 20:19:35 -05:00
proxy.js Use proxy agents for CLNRest over Tor (#1136) 2024-05-03 17:00:28 -05:00
rainbow.js undo zap/downzap and improve downzap ux 2023-12-19 19:55:19 -06:00
rand.js use rand lightning animation when not logged in 2021-07-16 11:47:18 -05:00
remark-mention.js fix mdast find and replace imports 2023-07-24 20:03:56 -05:00
remark-sub.js fix markdown inline code and headings 2023-10-23 17:14:37 -05:00
rss.js Use module path aliases (#938) 2024-03-19 19:37:31 -05:00
territory.js fix #951 also retroactively 2024-03-20 20:56:40 -05:00
time.js Monthly rewards (#890) 2024-03-01 10:28:55 -06:00
timedate-scraper.js Attempt to get publication year when auto-titling links (#520) 2023-10-20 19:23:50 -05:00
url.js add NEXT_PUBLIC_URL 2024-04-08 17:54:39 -05:00
url.spec.js fix: parseInternalLinks test (#1050) 2024-04-09 14:44:45 -05:00
validate.js Allow http: and ws: in dev CSP (#1126) 2024-05-03 14:17:10 -05:00
webPush.js Round sats in FORWARDEDTIP push notification (#1086) 2024-04-17 14:24:07 -05:00