whodis-react-storage-browser
Version:
React hooks and components for secure, best practices authentication in seconds
15 lines • 903 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.loadAuthenticationFromSSRReq = void 0;
const simple_cookie_client_1 = require("simple-cookie-client");
/**
* loads and exposes the cookies required for authentication from the server-side request
* - exposes both the `authorization` and `synchronization` tokens required for secure and consistent authentication in the web environment
* - enables isomorphically using whodis-react-storage-browser functions across both clientside and serverside environments
*/
const loadAuthenticationFromSSRReq = ({ req, }) => {
(0, simple_cookie_client_1.exposeCookieFromReq)({ name: 'authorization', req });
(0, simple_cookie_client_1.exposeCookieFromReq)({ name: 'synchronization', req });
};
exports.loadAuthenticationFromSSRReq = loadAuthenticationFromSSRReq;
//# sourceMappingURL=loadAuthenticationFromSSRReq.js.map