Rework login page to be AJAX/Vue.js based
This commit is contained in:
@@ -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.'
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user