Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ordergroove/auth

Package Overview
Dependencies
Maintainers
27
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ordergroove/auth - npm Package Compare versions

Comparing version 2.0.2 to 2.0.3

2

dist/auth.js

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.auth=t():(e.OG=e.OG||{},e.OG.auth=t())}(window,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";n.r(t),n.d(t,"ogAuthRegExp",function(){return r}),n.d(t,"readAuthCookie",function(){return o}),n.d(t,"parseAuth",function(){return u}),n.d(t,"iframeLoad",function(){return i}),n.d(t,"isJsonResponse",function(){return c}),n.d(t,"resolveAuth",function(){return f});const r=/^og_auth=/,o=(e=r)=>(document.cookie.split(/;\s*/).find(t=>t.match(e))||"").replace(r,""),u=e=>{if("object"==typeof e)return e;const t=(e||"").split("|");return 3===t.length?{sig_field:t[0],ts:parseInt(t[1],10),sig:t[2]}:null},i=e=>new Promise((t,n)=>{const r=document.createElement("iframe");document.body.appendChild(r),r.onload=t,r.onerror=n,r.src=e}),c=e=>-1!==(e.headers.get("content-type")||"").indexOf("application/json"),f=(e,t=o,n=i)=>Promise.resolve(t()||fetch(e).then(r=>t()||(c(r)?r.json():Promise.resolve(n(e)).then(t)))).then(u).then(e=>null===e?Promise.reject(new Error("Unauthorized")):e);t.default=f}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.auth=t():(e.OG=e.OG||{},e.OG.auth=t())}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";n.r(t),n.d(t,"ogAuthRegExp",(function(){return r})),n.d(t,"readAuthCookie",(function(){return o})),n.d(t,"parseAuth",(function(){return u})),n.d(t,"iframeLoad",(function(){return i})),n.d(t,"isJsonResponse",(function(){return c})),n.d(t,"resolveAuth",(function(){return f}));const r=/^og_auth=/,o=(e=r)=>(document.cookie.split(/;\s*/).find(t=>t.match(e))||"").replace(r,""),u=e=>{if("object"==typeof e)return e;const t=(e||"").split("|");return 3===t.length?{sig_field:t[0],ts:parseInt(t[1],10),sig:t[2]}:null},i=e=>new Promise((t,n)=>{const r=document.createElement("iframe");r.style.setProperty("display","none","important"),document.body.appendChild(r),r.onload=t,r.onerror=n,r.src=e}),c=e=>-1!==(e.headers.get("content-type")||"").indexOf("application/json"),f=(e,t=o,n=i)=>Promise.resolve(t()||fetch(e).then(r=>t()||(c(r)?r.json():Promise.resolve(n(e)).then(t)))).then(u).then(e=>null===e?Promise.reject(new Error("Unauthorized")):e);t.default=f}])}));
//# sourceMappingURL=auth.js.map
{
"name": "@ordergroove/auth",
"version": "2.0.2",
"version": "2.0.3",
"description": "",

@@ -28,3 +28,3 @@ "main": "dist/auth.js",

"license": "ISC",
"gitHead": "88cbbe24840362f486a73e0fe8e121a0455596a2"
"gitHead": "3ed3f14369c71a596a028a10942d90fa989fa0f1"
}

@@ -34,2 +34,3 @@ export const ogAuthRegExp = /^og_auth=/;

const iframe = document.createElement('iframe');
iframe.style.setProperty('display', 'none', 'important');
document.body.appendChild(iframe);

@@ -36,0 +37,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc