bc-node-sdk
Version:
BetterCommerce's NodeJS SDK encapsulates the base framework for all the Next.js applications.
25 lines (24 loc) • 866 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
// Other Imports
const constants_1 = require("../domain/constants");
/**
* Class {@link RequestUtil} encapsulates utility methods to process the request and cookies.
*
* @class RequestUtil
* @abstract
*/
class RequestUtil {
/**
* Retrieves the SSO user ID from the given cookies and returns it as an object
* @param cookies the cookies containing the SSO user id
* @returns an object with the SSO user id
*/
static getRequestCookies(cookies) {
var _a;
const ssoUserId = (_a = cookies.get(constants_1.Key.Cookie.USER_ID)) === null || _a === void 0 ? void 0 : _a.value;
const parsedCookies = { [constants_1.Key.Cookie.USER_ID]: ssoUserId };
return parsedCookies;
}
}
exports.default = RequestUtil;