/*
 * Home Controller
 * -------------------------------------------------------------
 * Controller for the main homepage of this Flitter app. Methods here
 * are used as handlers for routes specified in the route files.
 */
class Home {

    /*
     * Serve the main welcome page.
     */
    welcome(req, res){

        let pass = {}

        if ( req.session.auth && req.session.auth.user ){
            pass['user'] = req.session.auth.user
        }

        /*
         * Return the welcome view.
         * It must be passed the response.
         * View parameters can be passed as an optional third
         * argument to the view() method.
         */
        return _flitter.view(res, 'welcome', pass)
    }
}

module.exports = Home