
let moment = require('moment');

module.exports = {


    friendlyName: 'Email',


    description: 'Verify Email.',


    inputs: {


    },


    exits: {
        notFound: {
            description: 'User not found',
            statusCode: 404
        },
        encryptionError: {
            statusCode: 500
        }
    },


    fn: async function ({ }, exits) {

        const { id, user } = this.req.token;
        
        //console.log('USER', user)

        // USER NOT FOUND
        if (!user) {
            return exits.notFound('Identifiant incorrect')
        }

        if (user.email !== '') {
            let resp = true
            return exits.success(resp)

        } else {
            let resp = false

            return exits.success(resp)
        }

    }


};
