Skip to content
Snippets Groups Projects
Select Git revision
  • 006fca53be039620bc68c65bf1745bef47ef8dc7
  • master default
  • hwioauth
3 results

3bba8c

Blame
  • notifications.js 410 B
    const warn = (req, res, title, content) => {
      req.session.user.notifications.push({ title, content, color: "warning" });
      req.session.user.save();
    };
    
    const error = (req, res, title, content) => {
      req.session.user.notifications.push({ title, content, color: "error" });
      req.session.user.save();
      return res.redirect('/'); // TODO redirect to error route or previous
    };
    
    module.exports = { warn, error };