Added ensureAuthenticated
Added logout button and merged app.js