@shopify/shopify-app-remix
Version:
Shopify Remix - to simplify the building of Shopify Apps with Remix
22 lines (18 loc) • 766 B
JavaScript
;
var errors = require('../../errors.js');
var factory = require('../../clients/admin/factory.js');
var getOfflineSession = require('../helpers/get-offline-session.js');
function unauthenticatedAdminContextFactory(params) {
return async (shop) => {
const session = await getOfflineSession.getOfflineSession(shop, params);
if (!session) {
throw new errors.SessionNotFoundError(`Could not find a session for shop ${shop} when creating unauthenticated admin context`);
}
return {
session,
admin: factory.adminClientFactory({ params, session }),
};
};
}
exports.unauthenticatedAdminContextFactory = unauthenticatedAdminContextFactory;
//# sourceMappingURL=factory.js.map