Rework login page to be AJAX/Vue.js based

This commit is contained in:
garrettmills
2020-04-22 09:19:25 -05:00
parent 175c335542
commit d68d5141c8
30 changed files with 12965 additions and 79 deletions

View File

@@ -7,6 +7,9 @@ const Controller = require('libflitter/controller/Controller')
* are used as handlers for routes specified in the route files.
*/
class Home extends Controller {
static get services() {
return [...super.services, 'Vue']
}
/*
* Serve the main welcome page.
@@ -18,7 +21,16 @@ class Home extends Controller {
* The page() method is added by Flitter and passes some
* helpful contextual data to the view as well.
*/
return res.page('welcome', {user: req.user})
return res.page('welcome', {
user: req.user,
...this.Vue.data(),
})
}
async tmpl(req, res) {
return res.page('tmpl', this.Vue.data({
login_message: 'Please sign-in to continue.'
}))
}
}