2020-01-18 20:46:06 +00:00
|
|
|
'use strict'
|
|
|
|
|
|
|
|
class IndexController {
|
2020-02-15 18:07:23 +00:00
|
|
|
async index({auth, view}) {
|
|
|
|
try {
|
|
|
|
await auth.check();
|
|
|
|
return view.render('home');
|
|
|
|
} catch (e) {
|
|
|
|
const bgIndex = Math.ceil((Math.random() * 10) % 5);
|
|
|
|
return view.render('landing', {bgIndex});
|
2020-01-18 20:46:06 +00:00
|
|
|
}
|
2020-02-15 18:07:23 +00:00
|
|
|
}
|
2020-01-18 20:46:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = IndexController
|