mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-03 12:29:46 +08:00
957b4cf1a8
* Lots of stuff * Changed code order * Change message * Use strict comparison * Fix Bearer auth * changed failed validation message * removed full stops Co-authored-by: Miodec <bartnikjack@gmail.com>
16 lines
320 B
JavaScript
16 lines
320 B
JavaScript
const ConfigurationDAO = require("../dao/configuration");
|
|
|
|
async function contextMiddleware(req, res, next) {
|
|
const configuration = await ConfigurationDAO.getCachedConfiguration(true);
|
|
|
|
req.ctx = {
|
|
configuration,
|
|
decodedToken: {
|
|
uid: null,
|
|
},
|
|
};
|
|
|
|
next();
|
|
}
|
|
|
|
module.exports = contextMiddleware;
|