Middleware
-
Captures all errors and transforms them into an internal server error HTTP response.
See moreDeclaration
Swift
public final class SwiftarrErrorMiddleware : AsyncMiddleware
-
Declaration
Swift
struct CalendarSessionFixerMiddleware : AsyncMiddleware
-
Declaration
Swift
struct DisabledAPISectionMiddleware : AsyncMiddleware
-
Declaration
Swift
struct DisabledSiteSectionMiddleware : AsyncMiddleware
-
NotificationsMiddleware gets attached to Site routes, and periodically calls an API notification endpoint to get user notifications. The user notificaiton counts are then attached ot the user’s Session.
This setup is not ideal as a user with multiple Sessions on different devices may see different notificaitons at different times.
Currently this code breaks the UI/API layer separation somewhat by looking at the authenticated User. If we do need to build separate UI and API servers, we can either: * Stop inspecting the
See moreupdatedAt
property; notificaitons will be sligihtly less realtime. * Add a webSocket betwen the UI and API, pass usernames that have new notifications as they happen. * Use Redis pub/sub * Really, the communication is one-way – perhaps build a server endpoint in the UI code and the API layer acts as a client to call it? Via any method, Vapor Sessions aren’t set up for finding sessions by user, or accessing any other Session at all, really.Declaration
Swift
struct NotificationsMiddleware : AsyncMiddleware, SiteControllerUtils
-
Declaration
Swift
struct RequireAdminMiddleware : AsyncMiddleware
-
Declaration
Swift
struct RequireModeratorMiddleware : AsyncMiddleware
-
Declaration
Swift
struct RequireTHOMiddleware : AsyncMiddleware
-
Declaration
Swift
struct RequireTwitarrTeamMiddleware : AsyncMiddleware
-
All of these middleware must be inserted into the middlewaire chain AFTER the auth middleware.
See moreDeclaration
Swift
struct RequireVerifiedMiddleware : AsyncMiddleware
-
Captures all errors and transforms them into an internal server error HTTP response.
See moreDeclaration
Swift
public final class SiteErrorMiddleware : AsyncMiddleware
-
Declaration
Swift
struct SiteRequireAdminMiddleware : AsyncMiddleware
-
Declaration
Swift
struct SiteRequireModeratorMiddleware : AsyncMiddleware
-
Declaration
Swift
struct SiteRequireTHOMiddleware : AsyncMiddleware
-
Declaration
Swift
struct SiteRequireTwitarrTeamMiddleware : AsyncMiddleware
-
Declaration
Swift
struct SiteRequireVerifiedMiddleware : AsyncMiddleware