// REST API endpoints start with "/api" in their path.
// The 'assets' folder and login page are sessionless.
- if ((/^api/i).test(req.path.split("/")[2]) || (/^\/assets/i).test(req.path) || req.path === "/") {
+ if ((/^api/i).test(req.path.split("/")[2]) ||
+ (/^\/assets/i).test(req.path) ||
+ req.path === "/" ||
+ req.path === "/favicon.ico"
+ ) {
+
next();
} else {
if (req.path === "/login") {
// REST API endpoints start with "/api" in their path.
// The 'assets' folder and login page are sessionless.
- if ((/^api/i).test(req.path.split("/")[2]) || (/^\/assets/i).test(req.path) || req.path === "/") {
+ if ((/^api/i).test(req.path.split("/")[2]) ||
+ (/^\/assets/i).test(req.path) ||
+ req.path === "/" ||
+ req.path === "/favicon.ico"
+ ) {
+
next();
} else {
// Instead of doing app.use(passport.session())
* Setup HTTP routes and handlers.
*/
var that = this;
+
+app.use(express.favicon(__dirname + '/views/login/assets/favicon.ico'));
app.get('/:org/debug', function (req, res, next) {
"use strict";
if (!req.session.passport.user) {
return done && done(err);\r
};\r
\r
+ saveOptions.database = client.get("organization");\r
+\r
// Set model values and save.\r
token.set("state", "Token Refreshed");\r
token.set("accessToken", accesshash);\r
\r
// Get the org from the scope URI e.g. 'dev' from: 'https://mobile.xtuple.com/auth/dev'\r
scope = url.parse(scope[0], true);\r
- var scopeOrg = scope.path.match(/\/auth\/(.*)/)[1] || null;\r
+ var scopeOrg = scope.path.split("/")[1] || null;\r
\r
db.clients.findByClientId(clientID, scopeOrg, function (err, client) {\r
if (err) { return done(err); }\r
// Get the org from the scope URI e.g. 'dev' from: 'https://mobile.xtuple.com/auth/dev'
scope = url.parse(value, true);
- org = scope.path.match(/\/auth\/(.*)/)[1] || null;
+ org = scope.path.split("/")[1] || null;
// TODO - Still need more work to support userinfo calls.
// See node-datasource/oauth2/oauth2.js authorization.