30 lines
582 B
JavaScript
30 lines
582 B
JavaScript
/*
|
|
* This file is part of the authRXBN single sign-on package.
|
|
*
|
|
* (c) Ruben Meyer <contact@rxbn.de>
|
|
*/
|
|
|
|
var express = require('express');
|
|
var route = express.Router();
|
|
|
|
|
|
route.all('/', function(req, res, next) {
|
|
// TODO: show login page or dashboard
|
|
// res.end('login or dashboard');
|
|
res.render('index');
|
|
});
|
|
|
|
route.all('/*', (req, res, next) => {
|
|
// passthrough to next route
|
|
if(req.path.startsWith('/api'))
|
|
return next();
|
|
|
|
// TODO: try to login
|
|
// TODO: role-based authorization
|
|
// TODO: show login page or page
|
|
|
|
res.end('500 - LEL');
|
|
});
|
|
|
|
module.exports = route;
|