Noded/frontend#84 - make welcome page redirect to SPA by default
This commit is contained in:
parent
33944c1b86
commit
bebdd504dd
@ -15,19 +15,9 @@ class Home extends Controller {
|
||||
* Serve the main welcome page.
|
||||
*/
|
||||
welcome(req, res) {
|
||||
if (req.user) {
|
||||
// If we have a user, redirect them to the main app
|
||||
return res.redirect('/i')
|
||||
}
|
||||
|
||||
/*
|
||||
* Return the welcome view.
|
||||
* 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 });
|
||||
}
|
||||
|
||||
async get_login(req, res) {
|
||||
const AppName = this.configs.get('app.name');
|
||||
return res.page('login', { AppName });
|
||||
|
@ -167,6 +167,11 @@ class Page extends Controller {
|
||||
return res.api(return_nodes)
|
||||
}
|
||||
|
||||
async get_node(req, res) {
|
||||
let { page, node } = req.form
|
||||
return res.api(node)
|
||||
}
|
||||
|
||||
async save_node_to_page(req, res) {
|
||||
const { page } = req.form
|
||||
|
||||
|
@ -24,6 +24,13 @@ module.exports = exports = {
|
||||
['middleware::api:DataInjection', { access_level: 'view' }],
|
||||
'controller::api:v1:Page.get_nodes',
|
||||
],
|
||||
|
||||
// Get a particular node present on the specified page
|
||||
'/:PageId/nodes/:NodeId': [
|
||||
'middleware::auth:ApiRoute',
|
||||
['middleware::api:DataInjection', { access_level: 'view' }],
|
||||
'controller::api:v1:Page.get_node',
|
||||
],
|
||||
},
|
||||
|
||||
post: {
|
||||
|
Loading…
Reference in New Issue
Block a user