mirror of
https://github.com/PretendoNetwork/website.git
synced 2026-08-28 11:36:53 -05:00
chore(lint): set up .editorconfig, lint all
This commit is contained in:
@@ -149,4 +149,4 @@ async function updateStripeDonationCache() {
|
||||
module.exports = {
|
||||
getTrelloCache,
|
||||
getStripeDonationCache
|
||||
};
|
||||
};
|
||||
|
||||
@@ -24,4 +24,4 @@ async function connect() {
|
||||
module.exports = {
|
||||
connect,
|
||||
PNID
|
||||
};
|
||||
};
|
||||
|
||||
@@ -49,4 +49,4 @@ module.exports = {
|
||||
error,
|
||||
warn,
|
||||
info
|
||||
};
|
||||
};
|
||||
|
||||
@@ -19,4 +19,4 @@ async function sendMail(options) {
|
||||
|
||||
module.exports = {
|
||||
sendMail
|
||||
};
|
||||
};
|
||||
|
||||
@@ -10,4 +10,4 @@ async function redirectMiddleware(request, response, next) {
|
||||
return next();
|
||||
}
|
||||
|
||||
module.exports = redirectMiddleware;
|
||||
module.exports = redirectMiddleware;
|
||||
|
||||
@@ -5,7 +5,7 @@ async function renderDataMiddleware(request, response, next) {
|
||||
if (request.path.startsWith('/assets')) {
|
||||
return next();
|
||||
}
|
||||
|
||||
|
||||
// Get user local
|
||||
const reqLocale = request.locale;
|
||||
const locale = util.getLocale(reqLocale.region, reqLocale.language);
|
||||
@@ -40,4 +40,4 @@ async function renderDataMiddleware(request, response, next) {
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = renderDataMiddleware;
|
||||
module.exports = renderDataMiddleware;
|
||||
|
||||
@@ -7,4 +7,4 @@ async function requireLoginMiddleware(request, response, next) {
|
||||
return next();
|
||||
}
|
||||
|
||||
module.exports = requireLoginMiddleware;
|
||||
module.exports = requireLoginMiddleware;
|
||||
|
||||
@@ -61,7 +61,7 @@ router.get('/', requireLoginMiddleware, async (request, response) => {
|
||||
scope: ['identify', 'guilds'],
|
||||
state: crypto.randomBytes(16).toString('hex'),
|
||||
});
|
||||
|
||||
|
||||
renderData.discordAuthURL = discordAuthURL;
|
||||
}
|
||||
|
||||
@@ -396,7 +396,7 @@ router.post('/stripe/unsubscribe', requireLoginMiddleware, async (request, respo
|
||||
logger.error(`Error canceling old user subscription | ${pnid.get('connections.stripe.customer_id')}, ${pid}, ${subscriptionId} | - ${error.message}`);
|
||||
|
||||
response.cookie('error_message', 'Error canceling subscription! Contact support if issue persists', { domain: '.pretendo.network' });
|
||||
|
||||
|
||||
return response.redirect('/account');
|
||||
}
|
||||
}
|
||||
@@ -421,4 +421,4 @@ router.post('/stripe/webhook', express.raw({ type: 'application/json' }), async
|
||||
});
|
||||
|
||||
|
||||
module.exports = router;
|
||||
module.exports = router;
|
||||
|
||||
@@ -23,4 +23,4 @@ const PNIDSchema = new Schema({
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = PNIDSchema;
|
||||
module.exports = PNIDSchema;
|
||||
|
||||
@@ -144,7 +144,7 @@ app.engine('handlebars', handlebars({
|
||||
* get the string in the user's locale. If not available, it will return it in
|
||||
* the default locale.
|
||||
*/
|
||||
|
||||
|
||||
args.slice(1, -1).forEach(arg => {
|
||||
userLocaleString = userLocaleString?.[arg];
|
||||
});
|
||||
|
||||
@@ -148,7 +148,7 @@ function nintendoPasswordHash(password, pid) {
|
||||
Buffer.from('\x02\x65\x43\x46'),
|
||||
Buffer.from(password)
|
||||
]);
|
||||
|
||||
|
||||
const hashed = crypto.createHash('sha256').update(unpacked).digest().toString('hex');
|
||||
|
||||
return hashed;
|
||||
@@ -219,7 +219,7 @@ async function handleStripeEvent(event) {
|
||||
} catch (error) {
|
||||
logger.error(`Error sending email | ${customer.id}, ${customer.email} | - ${error.message}`);
|
||||
}
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -348,4 +348,4 @@ module.exports = {
|
||||
updateDiscordConnection,
|
||||
nintendoPasswordHash,
|
||||
handleStripeEvent
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user