@shopify/shopify-app-remix
Version:
Shopify Remix - to simplify the building of Shopify Apps with Remix
24 lines (20 loc) • 862 B
JavaScript
;
var ensureValidOfflineSession = require('../../helpers/ensure-valid-offline-session.js');
require('../../types.js');
require('@shopify/shopify-api');
var errors = require('../../errors.js');
var factory = require('../../clients/admin/factory.js');
function unauthenticatedAdminContextFactory(params) {
return async (shop) => {
const session = await ensureValidOfflineSession.ensureValidOfflineSession(params, shop);
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