mirror of
https://github.com/frappe/books.git
synced 2024-12-26 20:30:25 +00:00
fix: Remove unused auth module
This commit is contained in:
parent
e4ec2e11ee
commit
b5bd5c9e77
@ -14,7 +14,6 @@ const common = require('frappejs/common');
|
|||||||
const bodyParser = require('body-parser');
|
const bodyParser = require('body-parser');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const { setupExpressRoute: setRouteForPDF } = require('frappejs/server/pdf');
|
const { setupExpressRoute: setRouteForPDF } = require('frappejs/server/pdf');
|
||||||
const auth = require('./../auth/auth')();
|
|
||||||
const morgan = require('morgan');
|
const morgan = require('morgan');
|
||||||
const { addWebpackMiddleware } = require('../webpack/serve');
|
const { addWebpackMiddleware } = require('../webpack/serve');
|
||||||
const { getAppConfig, resolveAppDir } = require('../webpack/utils');
|
const { getAppConfig, resolveAppDir } = require('../webpack/utils');
|
||||||
@ -26,7 +25,7 @@ require.extensions['.html'] = function (module, filename) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
async start({backend, connectionParams, models, authConfig=null}) {
|
async start({backend, connectionParams, models}) {
|
||||||
await this.init();
|
await this.init();
|
||||||
|
|
||||||
if (models) {
|
if (models) {
|
||||||
@ -49,10 +48,6 @@ module.exports = {
|
|||||||
app.use(cors());
|
app.use(cors());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(authConfig) {
|
|
||||||
this.setupAuthentication(app, authConfig);
|
|
||||||
}
|
|
||||||
|
|
||||||
// socketio
|
// socketio
|
||||||
io.on('connection', function (socket) {
|
io.on('connection', function (socket) {
|
||||||
frappe.db.bindSocketServer(socket);
|
frappe.db.bindSocketServer(socket);
|
||||||
@ -80,7 +75,7 @@ module.exports = {
|
|||||||
|
|
||||||
async init() {
|
async init() {
|
||||||
frappe.isServer = true;
|
frappe.isServer = true;
|
||||||
await frappe.init();
|
frappe.init();
|
||||||
frappe.registerModels(frappeModels, 'server');
|
frappe.registerModels(frappeModels, 'server');
|
||||||
frappe.registerLibs(common);
|
frappe.registerLibs(common);
|
||||||
|
|
||||||
@ -92,11 +87,4 @@ module.exports = {
|
|||||||
await frappe.db.connect();
|
await frappe.db.connect();
|
||||||
await frappe.db.migrate();
|
await frappe.db.migrate();
|
||||||
},
|
},
|
||||||
|
|
||||||
setupAuthentication(app, authConfig) {
|
|
||||||
app.post("/api/signup", auth.signup);
|
|
||||||
app.post("/api/login", auth.login);
|
|
||||||
app.use(auth.initialize(authConfig));
|
|
||||||
app.all("/api/resource/*", auth.authenticate());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user