FoxxMD / context-mod

an event-based, reddit moderation bot built on top of snoowrap and written in typescript
https://contextmod.dev
MIT License
49 stars 11 forks source link

Refactor auth data structures to consolidate logic #71

Closed FoxxMD closed 2 years ago

FoxxMD commented 2 years ago

Currently auth checks (subreddits, operator, bot access, etc.) is done ad-hoc on both the client and server. There are well-defined auth entities (interfaces for user) but the actual logic is done inline.

This opens up the chance for typos and bugs all over the place like 66d9c0b2a7a501a4d5947693aac722284683544b

Need to refactor all of this auth logic so its all in one place. Reduces change of bugs and simplifies usage in routes, etc.