Comment all the things!

This commit is contained in:
2020-11-08 12:34:50 -06:00
parent 72f3923866
commit 06515b0559
73 changed files with 269 additions and 162 deletions

View File

@@ -1,18 +1,24 @@
const { Middleware } = require('libflitter')
/*
/**
* InjectUserTeam Middleware
* -------------------------------------------------------------
* For the authenticated user, looks up the associated Team instance
* and injects it as request.team.
* and injects it as request.user_team.
*
* @extends Middleware
*/
class InjectUserTeam extends Middleware {
static get services() {
return [...super.services, 'models']
}
/*
* Run the middleware test.
/**
* Inject the user's team into the request, or redirect to a login page.
* @param req
* @param res
* @param next
* @param [args = {}]
*/
async test(req, res, next, args = {}){
if ( !req.user ) return res.redirect('/auth/login')

View File

@@ -4,6 +4,8 @@
* Allows the request to proceed unless there's an authenticated user
* in the session. If so, redirect to the auth flow destination if one
* exists. If not, redirect to the default login route.
*
* This file was automatically generated by the Flitter framework.
*/
const Middleware = require('flitter-auth/middleware/GuestOnly')
class GuestOnly extends Middleware {

View File

@@ -4,6 +4,8 @@ const Middleware = require('flitter-auth/middleware/KeyAction')
* KeyAction Middleware
* -------------------------------------------------------------
* Middleware for processing key actions.
*
* This file was automatically generated by the Flitter framework.
*/
class KeyAction extends Middleware {

View File

@@ -3,6 +3,8 @@
* -------------------------------------------------------------
* Allows the request to proceed if a valid OAuth2 bearer token was
* provided. If not, return a JSON-encoded error message.
*
* This file was automatically generated by the Flitter framework.
*/
const Middleware = require('flitter-auth/middleware/Oauth2TokenOnly')
class Oauth2TokenOnly extends Middleware {

View File

@@ -3,6 +3,8 @@
* -------------------------------------------------------------
* Redirects the user to the login page if the registration page for
* a particular auth provider is not enabled.
*
* This file was automatically generated by the Flitter framework.
*/
const Middleware = require('flitter-auth/middleware/ProviderRegistrationEnabled')
class ProviderRegistrationEnabled extends Middleware {

View File

@@ -4,6 +4,8 @@
* Many auth routes specify the name of a particular auth provider to
* use. This middleware looks up the provider by that name and injects
* it into the request.
*
* This file was automatically generated by the Flitter framework.
*/
const Middleware = require('flitter-auth/middleware/ProviderRoute')
class ProviderRoute extends Middleware {

View File

@@ -4,6 +4,8 @@
* Allows the request to proceed if there's an authenticated user
* in the session. Otherwise, redirects the user to the login page
* of the default provider.
*
* This file was automatically generated by the Flitter framework.
*/
const Middleware = require('flitter-auth/middleware/UserOnly')
class UserOnly extends Middleware {

View File

@@ -4,6 +4,8 @@
* This should be applied globally. Ensures basic things about the
* request are true. For example, it provides the auth session data
* and handles auth flow.
*
* This file was automatically generated by the Flitter framework.
*/
const Middleware = require('flitter-auth/middleware/Utility')
class Utility extends Middleware {

View File

@@ -1,5 +1,7 @@
const Middleware = require('flitter-i18n/src/middleware/Localize')
/*
* This file was automatically generated by the Flitter framework.
*/
class LocalizeMiddleware extends Middleware {
}

View File

@@ -1,5 +1,8 @@
const Middleware = require('flitter-i18n/src/middleware/Scope')
/*
* This file was automatically generated by the Flitter framework.
*/
class ScopeMiddleware extends Middleware {
}

View File

@@ -16,6 +16,8 @@ const { Middleware } = require('libflitter')
*
* The 'value' attribute is optional. If none is provided, the request
* can proceed if the config value is truthy.
*
* This file was automatically generated by the Flitter framework.
*/
class Config extends Middleware {
static get services() {