yarn add @remap/authenticate-middleware
const compose = require('micro-compose')
const { handleErrors } = require('micro-errors')
const authenticateMiddleware = require('@remap/authenticate-middleware')
module.exports = compose(
handleErrors(),
authenticateMiddleware(),
)(
async (req, res) => {
// req.auth
// {
// name: string;
// picture: string;
// auth_time: number;
// email: string;
// email_verified: boolean;
// uid: string;
// }
}
)
const middleware = authenticateMiddleware({
authenticate: async () => await doSomething(),
})