4 ms·
`if (account["user_id"] === session.user.id || session.user.username === "sbf") {`
by programmarchy 4y ago
`if (account["user_id"] === session.user.id || session.user.username === "sbf") {`
- latchkey 4y agoIf his login username is `sbf`, the second condition would never be hit. Maybe you meant to write `&&`?
- programmarchy 4y agoHuh? (false || true) === true
- latchkey 4y agoMy point is that (true || true) === true
- programmarchy 4y ago(true || true) is the front door; (false || true) is the back door
- latchkey 4y agoWhy would he use something other than sbf as his primary account?
- deleted 4y ago[deleted]
- ALittleLight 4y agoThe joke is that he is spending money from other people's accounts.
- jlawson 4y agoNo, the first conditional checks if the logged-in user is allowed to access the account by ensuring that the the user and account match. OR, if the user is sbf, they always have access regardless of which account it is. That said this wouldn't really set up a line of credit but it is a way to give one user access to everyone's stuff.
- latchkey 4y agoMy point is that the first check would be true because the user is already sbf.
- elefanten 4y agoAssuming he’s using his own account. The joke is he was using all the accounts.
- tylersmith 4y agoThe premise is he's accessing other users accounts. "If the account being accessed belongs to the logged in user, or the logged in user is sbf."
- GrinningFool 4y agoThe first comparison is checking the ID so the rightful owner has access. The second comparison (unless it's been edited since you posted your comment) is checking the username against 'sbf'.