mirror of
https://github.com/Ride-The-Lightning/RTL.git
synced 2024-11-19 09:50:36 +01:00
062e38628f
* Updating Common Application Configuration * Fixed get RTL Conf * Update Application Settings * application and settings case change * Unified config models * Default node update * 2FA and Password reset * Final application settings update * Config Settings and Authentication case fixed * Node Setting Fix * Fiat currency Symbol fix * CLN: Fiat symbol fix * All: Fiat symbol fix * Update node settings * Services UI fix * CLN: Removed child node settings * All: Removed child node settings * Test fixes
24 lines
795 B
TypeScript
24 lines
795 B
TypeScript
import csurf from 'csurf/index.js';
|
|
import { Application } from 'express';
|
|
import { Logger, LoggerService } from './logger.js';
|
|
import { Common, CommonService } from './common.js';
|
|
|
|
class CSRF {
|
|
|
|
public csrfProtection = csurf({ cookie: true });
|
|
public logger: LoggerService = Logger;
|
|
public common: CommonService = Common;
|
|
|
|
public mount(app: Application): Application {
|
|
this.logger.log({ selectedNode: this.common.selectedNode, level: 'INFO', fileName: 'CSRF', msg: 'Setting up CSRF..' });
|
|
if (process.env.NODE_ENV !== 'development') {
|
|
app.use((req, res, next) => this.csrfProtection(req, res, next));
|
|
}
|
|
this.logger.log({ selectedNode: this.common.selectedNode, level: 'INFO', fileName: 'CSRF', msg: 'CSRF Set' });
|
|
return app;
|
|
};
|
|
|
|
}
|
|
|
|
export default new CSRF;
|