2025-11-16 06:28:11 -08:00

18 lines
293 B
JavaScript

/** @type {import('pocketpages').PageDataLoaderFunc} */
/**
*
* This middleware handles setting data.user for auth purposes
*/
module.exports = function ({ auth }, next) {
let user;
if (auth) {
user = $app.findFirstRecordByData('users', 'id', auth.id);
}
next({ user })
}