Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a6b7389201 | ||
|
|
5ccde1e34c | ||
|
|
8e018ad74a | ||
|
|
9e3981a7b1 | ||
|
|
f727a5c44a | ||
|
|
1165918cd6 | ||
|
|
b891d8f516 | ||
|
|
0a3a45107a | ||
|
|
90c5362a57 | ||
|
|
675b9051dc | ||
|
|
e063535127 | ||
|
|
2686af2208 | ||
|
|
81e6a60def | ||
|
|
389a744ebe | ||
|
|
84e73466e1 | ||
|
|
31ba4a0b8b | ||
|
|
dda5e89990 |
|
After Width: | Height: | Size: 46 KiB |
|
After Width: | Height: | Size: 96 KiB |
|
After Width: | Height: | Size: 131 KiB |
|
After Width: | Height: | Size: 129 KiB |
|
After Width: | Height: | Size: 99 KiB |
|
After Width: | Height: | Size: 599 KiB |
|
After Width: | Height: | Size: 1.8 MiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 165 KiB |
|
After Width: | Height: | Size: 8.0 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 110 KiB |
|
After Width: | Height: | Size: 43 KiB |
|
After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 62 KiB |
|
After Width: | Height: | Size: 7.7 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 60 KiB |
@@ -0,0 +1,361 @@
|
|||||||
|
@online{spa:1,
|
||||||
|
author = {t3n},
|
||||||
|
title = {Was ist eigentlich eine Single-Page-Webanwendung?},
|
||||||
|
month = {04},
|
||||||
|
year = {2018},
|
||||||
|
url = {https://t3n.de/news/single-page-webanwendung-1023623/},
|
||||||
|
note = {Zuletzt besucht am 26.02.2019}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{spa:2,
|
||||||
|
author = {Nebil Aboobacker},
|
||||||
|
title = {Was ist eine Single Page Application (SPA)?},
|
||||||
|
month = {05},
|
||||||
|
year = {2018},
|
||||||
|
url = {https://www.yuhiro.de/was-ist-eine-single-page-application-spa/},
|
||||||
|
note = {Zuletzt besucht am 26.02.2019}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{vue,
|
||||||
|
author = {Marc Teufel},
|
||||||
|
title = {Vue.js Tutorial: So entwickelt man Komponenten mit Vue.js},
|
||||||
|
month = {07},
|
||||||
|
year = {2018},
|
||||||
|
url = {https://entwickler.de/online/javascript/einfuehrung-vuejs-vue-579851816.html},
|
||||||
|
note = {Zuletzt besucht am 26.02.2019}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{vue:warum,
|
||||||
|
author = {Verena Sappelt},
|
||||||
|
title = {Vue.js – Vorteile: Das Beste aus zwei Welten},
|
||||||
|
month = {01},
|
||||||
|
year = {2019},
|
||||||
|
url = {https://www.ppw.de/blog/vue-js-vorteile-das-beste-aus-zwei-welten/},
|
||||||
|
note = {Zuletzt besucht am 26.02.2019}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{vue:router,
|
||||||
|
author = {Said Hayani},
|
||||||
|
title = {How to use routing in Vue.js to create a better user experience},
|
||||||
|
month = {06},
|
||||||
|
year = {2018},
|
||||||
|
url = {https://medium.freecodecamp.org/how-to-use-routing-in-vue-js-to-create-a-better-user-experience-98d225bbcdd9},
|
||||||
|
note = {Zuletzt besucht am 26.02.2019}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{vue:router2,
|
||||||
|
title = {Vue Router - Getting Started},
|
||||||
|
month = {01},
|
||||||
|
year = {2014},
|
||||||
|
url = {https://router.vuejs.org/guide/#javascript},
|
||||||
|
note = {Zuletzt besucht am 26.02.2019}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{vue:router3,
|
||||||
|
author = {Raymond Camden},
|
||||||
|
title = {Working with Routes in Vue.js},
|
||||||
|
month = {012},
|
||||||
|
year = {2017},
|
||||||
|
url = {https://www.raymondcamden.com/2017/11/12/working-with-routes-in-vue},
|
||||||
|
note = {Zuletzt besucht am 26.02.2019}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{api2,
|
||||||
|
author = {Björn Behrendt},
|
||||||
|
title = {Application-Programming-Interface (API)},
|
||||||
|
month = {06},
|
||||||
|
year = {2018},
|
||||||
|
url = {https://www.gruenderszene.de/lexikon/begriffe/application-programming-interface-api?interstitial},
|
||||||
|
note = {Zuletzt besucht am 26.02.2019}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{scrib,
|
||||||
|
title = {Scribble},
|
||||||
|
month = {08},
|
||||||
|
year = {2017},
|
||||||
|
url = {https://de.wikipedia.org/wiki/Scribble},
|
||||||
|
note = {Zuletzt besucht am 26.02.2019}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{md,
|
||||||
|
title = {Material Design},
|
||||||
|
month = {01},
|
||||||
|
year = {2019},
|
||||||
|
url = {https://de.wikipedia.org/wiki/Material_Design},
|
||||||
|
note = {Zuletzt besucht am 26.02.2019}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{md2,
|
||||||
|
author = {Google},
|
||||||
|
title = {Homepage Material Design},
|
||||||
|
url = {https://material.io},
|
||||||
|
note = {(o.D.), Zuletzt besucht am 26.02.2019}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{bootstrap,
|
||||||
|
author = {Federico Zivolo and Bootstrap contributors},
|
||||||
|
title = {Bootstrap Material Design},
|
||||||
|
month = {08},
|
||||||
|
year = {2018},
|
||||||
|
url = {https://fezvrasta.github.io/bootstrap-material-design/},
|
||||||
|
note = {Zuletzt besucht am 26.02.2019}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{less,
|
||||||
|
author = {Alexis Sellier },
|
||||||
|
title = {LESS - Die dynamische Stylesheet Sprache},
|
||||||
|
month = {01},
|
||||||
|
year = {2013},
|
||||||
|
url = {http://www.lesscss.de},
|
||||||
|
note = {Zuletzt besucht am 26.02.2019}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{ajax1,
|
||||||
|
author = {Jesse James Garret},
|
||||||
|
title = {Ajax: A New Approach to Web Applications},
|
||||||
|
month = {07},
|
||||||
|
year = {2008},
|
||||||
|
url = {https://web.archive.org/web/20080702075113/http://www.adaptivepath.com/ideas/essays/archives/000385.php},
|
||||||
|
note = {Zuletzt besucht am 26.02.2019}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{ajax2,
|
||||||
|
author = {Matthias Hertel},
|
||||||
|
title = {The AJAX Engine},
|
||||||
|
month = {02},
|
||||||
|
year = {2007},
|
||||||
|
url = {http://www.mathertel.de/AJAXEngine/#view=Home},
|
||||||
|
note = {Zuletzt besucht am 26.02.2019}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@book{ajax3,
|
||||||
|
author = {David Sawyer McFarland},
|
||||||
|
title = {JavaScript \& jQuery - the missing manual},
|
||||||
|
year = {2012},
|
||||||
|
publisher = {O'Reilly Media, inc.},
|
||||||
|
address = {1005 Gravenstein Highway North, Sebastopol, CA 95472},
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{api,
|
||||||
|
title = {Programmierschnittstelle},
|
||||||
|
month = {02},
|
||||||
|
year = {2019},
|
||||||
|
url = {https://de.wikipedia.org/wiki/Programmierschnittstelle},
|
||||||
|
note = {Zuletzt besucht am 26.02.2019}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{rest,
|
||||||
|
author = {Thomas Bayer},
|
||||||
|
title = {REST Web Services},
|
||||||
|
month = {11},
|
||||||
|
year = {2002},
|
||||||
|
url = {https://www.oio.de/public/xml/rest-webservices.htm},
|
||||||
|
note = {Zuletzt besucht am 26.02.2019}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{mongo,
|
||||||
|
title = {What is MongoDB?},
|
||||||
|
year = {2019},
|
||||||
|
url = {https://www.mongodb.com/what-is-mongodb},
|
||||||
|
note = {Zuletzt besucht am 26.02.2019}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@online{mongoose,
|
||||||
|
author = {Nick Karnik},
|
||||||
|
title = {Introduction to Mongoose for MongoDB},
|
||||||
|
month = {02},
|
||||||
|
year = {2018},
|
||||||
|
url = {https://medium.freecodecamp.org/introduction-to-mongoose-for-mongodb-d2a7aa593c57},
|
||||||
|
note = {Zuletzt besucht am 26.02.2019}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{Bear,
|
||||||
|
author = {Sevilleja, Chris},
|
||||||
|
month = {02},
|
||||||
|
year = {2019},
|
||||||
|
title = {Build a RESTful API Using Node and Express 4},
|
||||||
|
url = {https://scotch.io/tutorials/build-a-restful-api-using-node-and-express-4},
|
||||||
|
note = {Zuletzt besucht am 01.03.219}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@online{gitefi,
|
||||||
|
author = {Matthias Hopf},
|
||||||
|
month = {02},
|
||||||
|
year = {2019},
|
||||||
|
title = {Git efi},
|
||||||
|
url = {https://git.efi.th-nuernberg.de/gitea/hopfma/om/wiki/_pages},
|
||||||
|
note = {Zuletzt besucht am 25.02.2019}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@online{Powtoon,
|
||||||
|
title = {Powtoon - Brings Awesomeness to your presentations},
|
||||||
|
month = {02},
|
||||||
|
year = {2019},
|
||||||
|
url = {https://www.powtoon.com/my-powtoons/#/},
|
||||||
|
note = {Zuletzt besucht am 01.03.219}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@online{Risingstack,
|
||||||
|
author = {Gergely Nemeth},
|
||||||
|
year = {2017},
|
||||||
|
title = {10 Best Practices for Writing Node.js REST APIs | @RisingStack},
|
||||||
|
url = {https://blog.risingstack.com/10-best-practices-for-writing-node-js-rest-apis/},
|
||||||
|
note = {Zuletzt besucht am 01.03.2019}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{trello:uri,
|
||||||
|
author = {ATLASSIAN},
|
||||||
|
title = {Trello},
|
||||||
|
year = {2019},
|
||||||
|
url = {https://trello.com/home},
|
||||||
|
note = {(Zuletzt besucht am 25.02.2019)}
|
||||||
|
}
|
||||||
|
@online{trello:price,
|
||||||
|
author = {ATLASSIAN},
|
||||||
|
title = {Trello-Preisliste},
|
||||||
|
year = {2019},
|
||||||
|
url = {https://trello.com/pricing},
|
||||||
|
note = {(Zuletzt besucht am 25.02.2019)}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{bitrix:uri,
|
||||||
|
author = {Bitrix, Inc.},
|
||||||
|
title = {Führende Kostenlose Plattform Für Kommunikation Und Zusammenarbeit Mit Aufgaben, Projekten, CRM, Dokumenten, Chat u.v.a.m.},
|
||||||
|
year = {2019},
|
||||||
|
url = {https://www.bitrix24.de/},
|
||||||
|
note = {(Zuletzt besucht am 25.02.2019)}
|
||||||
|
}
|
||||||
|
@online{bitrix:feature,
|
||||||
|
author = {Bitrix, Inc.},
|
||||||
|
title = {Bitrix24: Führende kostenlose Software zum Projektmanagement},
|
||||||
|
year = {2019},
|
||||||
|
url = {https://www.bitrix24.de/tools/tasks_and_projects/},
|
||||||
|
note = {(Zuletzt besucht am 25.02.2019)}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{sw:staleWhileRevalidate,
|
||||||
|
author = {Jake Archibald},
|
||||||
|
title = {The offline cookbook - JakeArchibald.com},
|
||||||
|
month = {12},
|
||||||
|
year = {2014},
|
||||||
|
url = {https://jakearchibald.com/2014/offline-cookbook/#stale-while-revalidate},
|
||||||
|
note = {(Zuletzt besucht am 26.02.2019)}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{sw:cacheBackToNetwork,
|
||||||
|
author = {Jake Archibald},
|
||||||
|
title = {The offline cookbook - JakeArchibald.com},
|
||||||
|
month = {12},
|
||||||
|
year = {2014},
|
||||||
|
url = {https://jakearchibald.com/2014/offline-cookbook/#cache-falling-back-to-network},
|
||||||
|
note = {(Zuletzt besucht am 26.02.2019)}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{sw:networkBackToCache,
|
||||||
|
author = {Jake Archibald},
|
||||||
|
title = {The offline cookbook - JakeArchibald.com},
|
||||||
|
month = {12},
|
||||||
|
year = {2014},
|
||||||
|
url = {https://jakearchibald.com/2014/offline-cookbook/#network-falling-back-to-cache},
|
||||||
|
note = {(Zuletzt besucht am 26.02.2019)}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{sw:cacheThenNetwork,
|
||||||
|
author = {Jake Archibald},
|
||||||
|
title = {The offline cookbook - JakeArchibald.com},
|
||||||
|
month = {12},
|
||||||
|
year = {2014},
|
||||||
|
url = {https://jakearchibald.com/2014/offline-cookbook/#cache-then-network},
|
||||||
|
note = {(Zuletzt besucht am 26.02.2019)}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{api:doku,
|
||||||
|
author = {Erik Römmelt},
|
||||||
|
title = {Build, Collaborate \& Integrate APIs | SwaggerHub - OHM News API},
|
||||||
|
month = {02},
|
||||||
|
year = {2019},
|
||||||
|
url = {https://app.swaggerhub.com/apis-docs/roemmelter/om_api/1.0},
|
||||||
|
note = {(Zuletzt besucht am 26.02.2019)}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{dev:homescreen,
|
||||||
|
author = {Pete LePage},
|
||||||
|
title = {Your First Progressive Web App | Web Fundamentals | Google Developers},
|
||||||
|
month = {01},
|
||||||
|
year = {2019},
|
||||||
|
url = {https://developers.google.com/web/fundamentals/codelabs/your-first-pwapp/#support_native_integration},
|
||||||
|
note = {(Zuletzt besucht am 26.02.2019)}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{dev:codeSource,
|
||||||
|
author = {Pete LePage},
|
||||||
|
title = {Your First Progressive Web App | Web Fundamentals | Google Developers},
|
||||||
|
month = {01},
|
||||||
|
year = {2019},
|
||||||
|
url = {https://developers.google.com/web/fundamentals/codelabs/your-first-pwapp/},
|
||||||
|
note = {(Zuletzt besucht am 26.02.2019)}
|
||||||
|
}
|
||||||
|
|
||||||
|
%Senta:
|
||||||
|
@online{q1,
|
||||||
|
author = {Rafael Beraldo},
|
||||||
|
title = {Buefy Autocomplete},
|
||||||
|
year = {2019},
|
||||||
|
url = {https://buefy.org/documentation/autocomplete/},
|
||||||
|
note = {Zuletzt besucht am 07.08.2019}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{q2,
|
||||||
|
author = {MongoDB,Inc},
|
||||||
|
title = {Mongodb Manual Text Index},
|
||||||
|
year = {2019},
|
||||||
|
url = {https://docs.mongodb.com/manual/core/index-text/},
|
||||||
|
note = {Zuletzt besucht am 07.08.2019}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{q3,
|
||||||
|
author = {MongoDB,Inc},
|
||||||
|
title = {Mongodb Manual Text Search},
|
||||||
|
year = {2019},
|
||||||
|
url = {https://docs.mongodb.com/manual/text-search/},
|
||||||
|
note = {Zuletzt besucht am 07.08.2019}
|
||||||
|
}
|
||||||
|
|
||||||
|
@book{q4,
|
||||||
|
title = {JavaScript \& jQuery - the missing manual},
|
||||||
|
author = {D. S. McFarland},
|
||||||
|
year = {2012},
|
||||||
|
publisher = {O’Reilly Media, inc.}
|
||||||
|
}
|
||||||
|
%Edwina:
|
||||||
|
@online{vuetify,
|
||||||
|
author = {Vuetify},
|
||||||
|
title = {Why Vuetify?},
|
||||||
|
year = {2016-2019},
|
||||||
|
url = {https://vuetifyjs.com/en/getting-started/why-vuetify},
|
||||||
|
note = {Zuletzt besucht am 07.08.2019}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{buefy,
|
||||||
|
author = {Stackshare},
|
||||||
|
title = {Buefy vs. Vuetify},
|
||||||
|
year = {2019},
|
||||||
|
url = {https://stackshare.io/stackups/buefy-vs-vuetify},
|
||||||
|
note = {Zuletzt besucht am 07.08.2019}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{bulma,
|
||||||
|
author = {Wikipedia},
|
||||||
|
title = {Bulma (Framework)},
|
||||||
|
day = {23},
|
||||||
|
month = {05},
|
||||||
|
year = {2019},
|
||||||
|
url = {https://de.wikipedia.org/wiki/Bulma_(Framework)},
|
||||||
|
note = {Zuletzt besucht am 07.08.2019}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
var db = db.getSiblingDB('omdb');
|
var db = db.getSiblingDB('om');
|
||||||
|
|
||||||
// Delete all collections + all records
|
// Delete all collections + all records
|
||||||
db.messages.deleteMany({});
|
//db.messages.deleteMany({});
|
||||||
db.tags.deleteMany({});
|
//db.tags.deleteMany({});
|
||||||
db.users.deleteMany({});
|
//db.users.deleteMany({});
|
||||||
db.sessions.deleteMany({});
|
//db.sessions.deleteMany({});
|
||||||
|
|
||||||
// Insert data in collections
|
// Insert data in collections
|
||||||
load('mong_msg.js');
|
//load('mong_msg.js');
|
||||||
load('mong_tag.js');
|
load('mong_tag.js');
|
||||||
load('mong_usr.js');
|
load('mong_usr.js');
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
db.users.insert([
|
db.users.insert([
|
||||||
// User: author, Pwd: author
|
// User: author, Pwd: author
|
||||||
{"_id":"author","name":"Author","type":"MA@EFI;","roles":'{"user":true,"author":true}',"hash":"sha256","salt":"SIzKNsNKsCRVr8a9U90q6A==","pwd":"HZly68TSAKHioz6Kz0QCbXVTHpT6hMmabUbFYVlCMeE=","abos":["nulla","tempor","veniam","ipsum"],"bookmarks":[],},
|
{"_id":"author","name":"Author","type":"PF@EFI;","roles":{"user":true,"author":true},"hash":"sha256","salt":"SIzKNsNKsCRVr8a9U90q6A==","pwd":"HZly68TSAKHioz6Kz0QCbXVTHpT6hMmabUbFYVlCMeE=","abos":[],"bookmarks":[]},
|
||||||
// User: admin, Pwd: SwenMho
|
// User: admin, Pwd: SwenMho
|
||||||
{"_id":"admin","name":"Test Admin","type":"MA@AMP;","roles":'{"user":true,"author":true,"admin":true}',"hash":"sha256","salt":"z3PNXGmQaWvaT7m2ZlT+0w==","pwd":"nfUfNv032J745xj3Hzya3Mkk43Dz/H0BmNTZhtx8UM0=","abos":["veniam","ipsum"],"bookmarks":[],},
|
// {"_id":"admin","name":"Test Admin","type":"MA@AMP;","roles":'{"user":true,"author":true,"admin":true}',"hash":"sha256","salt":"z3PNXGmQaWvaT7m2ZlT+0w==","pwd":"nfUfNv032J745xj3Hzya3Mkk43Dz/H0BmNTZhtx8UM0=","abos":["veniam","ipsum"],"bookmarks":[],},
|
||||||
])
|
])
|
||||||
|
|
||||||
//var c = require('./server/crypto.js'),
|
//var c = require('./server/crypto.js'),
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ app.use(session({
|
|||||||
mongooseConnection: mong.connection,
|
mongooseConnection: mong.connection,
|
||||||
ttl: 30 * 24 * 3600,
|
ttl: 30 * 24 * 3600,
|
||||||
}), // mongoose + connect-mongo
|
}), // mongoose + connect-mongo
|
||||||
//store: new MemoryStore ({checkPeriod: 24*3600*1000}), // memorystore
|
// store: new MemoryStore ({checkPeriod: 24*3600*1000}), // memorystore
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// Favicon for Desktop
|
// Favicon for Desktop
|
||||||
@@ -112,7 +112,7 @@ app.use('/api', api_routes);
|
|||||||
app.use(express.static(__dirname + '/public'));
|
app.use(express.static(__dirname + '/public'));
|
||||||
|
|
||||||
// Other stuff is NOT authorized unless logged in
|
// Other stuff is NOT authorized unless logged in
|
||||||
app.use (authorize.genCheckAuthorized ('user'));
|
//app.use (authorize.genCheckAuthorized ('user'));
|
||||||
|
|
||||||
// No error so far? Then it's a 404!
|
// No error so far? Then it's a 404!
|
||||||
app.use(function (req, res, next) {
|
app.use(function (req, res, next) {
|
||||||
|
|||||||
@@ -14,13 +14,13 @@ const clientVisibleSession = { user: true, name: true, type: true, mail: true, r
|
|||||||
|
|
||||||
// Return user role, query from found.mail
|
// Return user role, query from found.mail
|
||||||
function getUserRole(found) {
|
function getUserRole(found) {
|
||||||
var roles = "user";
|
var roles = "user:true";
|
||||||
var mail = found.mail;
|
var mail = found.mail;
|
||||||
if (!/\d/.test(mail)) {
|
if (!/\d/.test(mail)) {
|
||||||
// Mail contains no number
|
// Mail contains no number
|
||||||
roles += ',"author"';
|
roles += ',"author:true"';
|
||||||
}
|
}
|
||||||
return JSON.stringify('{'+roles+'}');
|
return ('{'+roles+'}');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fill in session object
|
// Fill in session object
|
||||||
@@ -127,9 +127,9 @@ const authorization = {
|
|||||||
Users.findById (req.body.user) .exec (function (err, entry) {
|
Users.findById (req.body.user) .exec (function (err, entry) {
|
||||||
// If there is a local user AND it has a password associated, test against this, and only this
|
// If there is a local user AND it has a password associated, test against this, and only this
|
||||||
if (entry != null && entry.pwd) {
|
if (entry != null && entry.pwd) {
|
||||||
|
console.info(entry);
|
||||||
if (crypto.checkLocalAuth (entry, req.body.pwd)) {
|
if (crypto.checkLocalAuth (entry, req.body.pwd)) {
|
||||||
console.info(entry.roles);
|
return fillSession (req, entry, entry.roles, returnSession);
|
||||||
return fillSession (req, entry, JSON.parse(entry.roles), returnSession);
|
|
||||||
}
|
}
|
||||||
return returnError ();
|
return returnError ();
|
||||||
}
|
}
|
||||||
@@ -151,7 +151,7 @@ const authorization = {
|
|||||||
entry.type = found.type;
|
entry.type = found.type;
|
||||||
if (! entry.orclgender || entry.orclgender === "")
|
if (! entry.orclgender || entry.orclgender === "")
|
||||||
entry.orclgender = found.orclgender;
|
entry.orclgender = found.orclgender;
|
||||||
return fillSession (req, entry, entry.roles.length > 0 ? common.arrayToHash(entry.roles) : {user:true}, returnSession);
|
return fillSession (req, entry, entry.roles.length > 0 ? entry.roles : {user:true}, returnSession);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Otherwise create standard user entry
|
// Otherwise create standard user entry
|
||||||
|
|||||||
@@ -305,7 +305,7 @@ const dbs = {
|
|||||||
* Local db: common.config.dbLocalConn
|
* Local db: common.config.dbLocalConn
|
||||||
* TH db: common.config.dbConn
|
* TH db: common.config.dbConn
|
||||||
*/
|
*/
|
||||||
common.mongoose.connect(common.config.dbLocalConn, {
|
common.mongoose.connect(common.config.dbConn, {
|
||||||
useNewUrlParser: true
|
useNewUrlParser: true
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
console.log("Database connected successfully.");
|
console.log("Database connected successfully.");
|
||||||
@@ -386,18 +386,4 @@ const dbs = {
|
|||||||
models: model,
|
models: model,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
app.get ("/api/msg/search/:phrase", function (req, res) {
|
|
||||||
Message.find ({$text: {$search: req.params.phrase}) .then (function (err, results){
|
|
||||||
if (err) {
|
|
||||||
console.log (err);
|
|
||||||
res .status(404) .json (err);
|
|
||||||
} else {
|
|
||||||
console.log(JSON.stringify(results));
|
|
||||||
res.json(results);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
*/
|
|
||||||
module.exports = dbs;
|
module.exports = dbs;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"dbConn": "mongodb://127.0.0.1:27017/om",
|
"dbConn": "mongodb://om:aeg1phuKeDaixese@127.0.0.1:27017/om",
|
||||||
"dbLocalConn": "mongodb://localhost:27017/omdb",
|
"dbLocalConn": "mongodb://localhost:27017/omdb",
|
||||||
"dbUser": "om",
|
"dbUser": "om",
|
||||||
"dbPwd": "aeg1phuKeDaixese",
|
"dbPwd": "aeg1phuKeDaixese",
|
||||||
|
|||||||