Skip to content

Feat flowsheet middleware#27

Merged
AyBruno merged 2 commits intomainfrom
feat-flowsheet-middleware
Aug 27, 2024
Merged

Feat flowsheet middleware#27
AyBruno merged 2 commits intomainfrom
feat-flowsheet-middleware

Conversation

@AyBruno
Copy link
Collaborator

@AyBruno AyBruno commented Aug 26, 2024

Middleware used to block access to certain controllers based on DJ state

  • checkActiveShow.ts contains logic to only continue on to further middleware iff there is a currently active show.
  • checkShowMember.ts contains logic to only continue on to further middleware iff the requesting dj is a member of the current show. This function relies on the cognito middlware in order to work as it compares values located in the decoded token (which gets stored in res.locals) against our database. Because of this it is important that it is always called after cognitoMiddleware() in the chain of middeware. (sheesh I've typed middleware a lot here)

I've also included in app.ts a testing endpoint to demonstrate the usage of both of these middleware functions.

Added two blocking middlewares. One to check for active shows and another to check whether the requesting dj is a memeber of the current show
Added testing endpoint to application to display usage of flowsheet middleware
@AyBruno AyBruno merged commit 849bcbb into main Aug 27, 2024
@AyBruno AyBruno deleted the feat-flowsheet-middleware branch August 27, 2024 03:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants