module.exports = (req, type) => {
    let { blackbox } = req;

    if (!blackbox) {
        return {};
    }

    let { users = [] } = type === 'raw' ? blackbox.raw || {} : blackbox;

    return users.find(({ id }) => id === blackbox.uid) || {};
};
