Commit e32c0fcc authored by Wolfgang Knopki's avatar Wolfgang Knopki
Browse files

change of header if email is valid

parent eb839e6c
...@@ -23,6 +23,12 @@ $.get( "/api/v1/profile", function(data) { ...@@ -23,6 +23,12 @@ $.get( "/api/v1/profile", function(data) {
$("#inputIndustry").val(industry); $("#inputIndustry").val(industry);
$("#inputOrganisation").val(organisation); $("#inputOrganisation").val(organisation);
$("#inputSpeciality").val(speciality); $("#inputSpeciality").val(speciality);
// check for valid email and then change header accordingly:
if(email != ''){
document.getElementById("navbarDropdown4").innerHTML="Logout";
document.getElementById("navbarDropdown4").href="/account/logout";
}
}) })
.done(function() { .done(function() {
console.log("done"); console.log("done");
......
...@@ -88,7 +88,7 @@ module.exports = function (app, config, passport) { ...@@ -88,7 +88,7 @@ module.exports = function (app, config, passport) {
); );
app.get('/profile', function (req, res) { app.get('/profile', function (req, res) {
if (req.isAuthenticated()) { if (req.isAuthenticated()) {
res.render('profile', { res.render('profile', {
user: req.user // useful for view engine, useless for HTML user: req.user // useful for view engine, useless for HTML
}); });
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment