2
0
mirror of https://github.com/frappe/books.git synced 2024-11-10 07:40:55 +00:00

fix: Remove unused auth module

This commit is contained in:
Faris Ansari 2019-12-10 01:30:01 +05:30
parent e4ec2e11ee
commit b5bd5c9e77

View File

@ -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());
}
} }