2
0
mirror of https://github.com/frappe/books.git synced 2024-12-25 12:10:06 +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 fs = require('fs');
const { setupExpressRoute: setRouteForPDF } = require('frappejs/server/pdf');
const auth = require('./../auth/auth')();
const morgan = require('morgan');
const { addWebpackMiddleware } = require('../webpack/serve');
const { getAppConfig, resolveAppDir } = require('../webpack/utils');
@ -26,7 +25,7 @@ require.extensions['.html'] = function (module, filename) {
};
module.exports = {
async start({backend, connectionParams, models, authConfig=null}) {
async start({backend, connectionParams, models}) {
await this.init();
if (models) {
@ -49,10 +48,6 @@ module.exports = {
app.use(cors());
}
if(authConfig) {
this.setupAuthentication(app, authConfig);
}
// socketio
io.on('connection', function (socket) {
frappe.db.bindSocketServer(socket);
@ -80,7 +75,7 @@ module.exports = {
async init() {
frappe.isServer = true;
await frappe.init();
frappe.init();
frappe.registerModels(frappeModels, 'server');
frappe.registerLibs(common);
@ -92,11 +87,4 @@ module.exports = {
await frappe.db.connect();
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());
}
}