verifySession() {
        if (!this.request.session.user) {
            if (this.view === 'login' || this.view === 'register') {
                return this.renderView()
            } else {
                return this.response.redirect('/login', 401, {
                    data: this.payload
                })
            }
        } else {
            this.payload.loggedIn = true
            return this.renderView()
        }
    }
/**
     * Check if a user is logged in before rendering a view
     */
Check if a user is logged in before rendering a view
Check if a user is logged in before rendering a view
verifySession() {
        if (!this.request.session.user) {
            if (this.view === 'login' || this.view === 'register') {
                return this.renderView()
            } else {
                return this.response.redirect('/login', 401, {
                    data: this.payload
                })
            }
        } else {
            this.payload.loggedIn = true
            return this.renderView()
        }
    }
verifySession ( ) { if ( ! this . request . session . user ) { if ( this . view === 'login' || this . view === 'register' ) { return this . renderView ( ) } else { return this . response . redirect ( '/login' , 401 , { data : this . payload } ) } } else { this . payload . loggedIn = true return this . renderView ( ) } }
Check if a user is logged in before rendering a view
Check if a user is logged in before rendering a view