Screenshot of different section of Server.js file showing the Polka handlers in a forEach loop being cast to the HanderlerWithFilePathMixin: // Does this route require authentication? let authenticationRequired = false const route = this.app.find(request.method, request.url) route.handlers.forEach(handler => { const handlerWithFilePathMixin = /** @type HandlerWithFilePathMixin */ (handler) if (handlerWithFilePathMixin.filePath !== undefined) { if (handlerWithFilePathMixin.filePath.match(authenticationRequiredIndicator) !== null) { authenticationRequired = true } } }) if (authenticationRequired) { // Person needs to authenticate to access this route. request.session.redirectToAfterSignIn = request.path response.writeHead(303, { Location: '/sign-in/' })
https://s3-eu-central-1.amazonaws.com/mastodon-aral/media_attachments/files/110/530/680/492/451/148/original/239e46f5bf6be808.png