//passport.authenticate('local', { successReturnToOrRedirect: '/login/scope', failureRedirect: '/', failureFlash: 'Invalid username or password.' }),
passport.authenticate('local', { failureRedirect: '/?login=fail' }),
function (req, res, next) {
-
+ var pathName = "/app";
if (req && req.session && !req.session.oauth2 && req.session.passport && req.session.passport.user && req.session.passport.user.organization) {
- res.redirect("/" + req.session.passport.user.organization + '/app');
+ if (req.body.hash && req.body.hash.charAt(0) === "#") {
+ pathName = pathName + req.body.hash;
+ }
+ res.redirect("/" + req.session.passport.user.organization + pathName);
//next();
} else {
exports.scopeForm(req, res, next);
<section id="main">
<div style="transform: translateZ(0px); opacity: 1;" id="form-fields">
<form name="loginForm" action="/login" method="post">
+ <input type="hidden" id="hash" name="hash">
<div class="login-label" id="form-fields_idLabel">Username</div>
<input class="login-input" id="form-fields_id" name="id" placeholder="Username">
<div class="login-label" id="form-fields_passwordLabel">Password</div>
<% } %>
</section>
- <!-- <div class="footer">
- <div class="footer-container">
- <p>
- Visit the <a href='http://www.xtuple.org/docs/mobile-web-demo-guide'>Mobile Web Demo Guide</a>,
- or send email to <a href='mailto:demo@xtuple.com'>demo@xtuple.com</a> for help.
- </p>
-
- <p>
- This MOBILE WEB CLIENT provides access the CRM, Project and Sales modules of xTuple.
- You must use the DESKTOP CLIENT to access the full application, including CRM, Projects, Sales, Purchasing, Inventory, Manufacturing, Scheduling and Accounting modules.
- </p>
-
- <p>
- Download the xTuple Desktop client here: <a href=''>Windows</a>,
- <a href=''>Mac</a>, <a href=''>Linux</a>
- </p>
-
- <p>v1.4.5</p>
- </div>
- </div> -->
-
<script>
document.loginForm.id.focus();
+ document.loginForm.hash.value = window.location.hash;
</script>
</body>
</html>