UNPKG

@koempf/shopgate-utility

Version:

Shopgate WebCheckout utility for Kömpf

14 lines (9 loc) 459 B
'use strict' const _getStorage = context => context.meta.userId ? context.storage.user : context.storage.device const getSessionContext = async context => _getStorage(context).get('sessionContext') const saveSessionContext = async (sessionContext, context) => _getStorage(context).set('sessionContext', sessionContext) .catch(err => context.log.error(err, 'Failed to save context token.')) module.exports = { getSessionContext, saveSessionContext }