znci / web

0 stars 0 forks source link

Auth #9

Closed blockarchitech closed 1 year ago

blockarchitech commented 1 year ago
blockarchitech commented 1 year ago

FYI, this is the new .env:

# znciweb secrets

SESSION_SECRET=b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAlwAAAAdzc2gtcn
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa # yes, this is an ssh key. don't judge me.

# discord secrets
CLIENT_SECRET=abc
CLIENT_ID=abc
REDIRECT_URI=http://localhost:3000/oauth/callback
blockarchitech commented 1 year ago

A firebase service account named serviceAccountKey.json is also required now

blockarchitech commented 1 year ago

Only places I'm using var is in bin/www as those might be mutated at runtime, and routes/oauth which generally is good practice.

See the new fix, however.

blockarchitech commented 1 year ago

As for whitespace, this was formatted using Prettier before PR.

Also, could you elaborate on Firestore queries? This is the way I've always known to use.

cerqiest commented 1 year ago

Prettier doesn't automatically add whitespace, for example, after variable definitions and before for/if statements. How is using var anywhere a good practice? I believe I saw it in the routes as well. Relating to the queries, async/await should probably be the way to go for a better DX (no .then chains).

cerqiest commented 1 year ago

If I recall correctly, express can handle async functions correctly but I don't know if that is good practice or breaks anything else. Reviewing new changes now.

blockarchitech commented 1 year ago

You cannot mutate a constant.

cerqiest commented 1 year ago

Wdym?

blockarchitech commented 1 year ago

let a = "b";
var b = "a";

a = "a" // error
b = "b" // good
cerqiest commented 1 year ago

See Discord.