New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

redux-oauth

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redux-oauth - npm Package Compare versions

Comparing version 2.0.2 to 2.0.3

2

dist/bundle.js

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

!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("immutable"),require("redux-immutablejs"),require("lodash/keys"),require("lodash/assign"),require("js-cookie"),require("isomorphic-fetch"),require("lodash/isArray"),require("lodash/isNull"),require("lodash/omit"),require("querystring"),require("url"));else if("function"==typeof define&&define.amd)define(["immutable","redux-immutablejs","lodash/keys","lodash/assign","js-cookie","isomorphic-fetch","lodash/isArray","lodash/isNull","lodash/omit","querystring","url"],t);else{var r="object"==typeof exports?t(require("immutable"),require("redux-immutablejs"),require("lodash/keys"),require("lodash/assign"),require("js-cookie"),require("isomorphic-fetch"),require("lodash/isArray"),require("lodash/isNull"),require("lodash/omit"),require("querystring"),require("url")):t(e.immutable,e["redux-immutablejs"],e["lodash/keys"],e["lodash/assign"],e["js-cookie"],e["isomorphic-fetch"],e["lodash/isArray"],e["lodash/isNull"],e["lodash/omit"],e.querystring,e.url);for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(this,function(e,t,r,n,u,o,i,a,c,s,f){return function(e){function t(n){if(r[n])return r[n].exports;var u=r[n]={exports:{},id:n,loaded:!1};return e[n].call(u.exports,u,u.exports,t),u.loaded=!0,u.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){e.exports=r(20)},function(e,t){"use strict";function r(e){return{backend:n(e),cookieOptions:u(e),tokenFormat:o(e)}}function n(e){var t=""+e.auth.getIn(["config","backend","apiUrl"]),r={};return e.auth.getIn(["config","backend","authProviderPaths"]).forEach(function(e,n){return r[n]=""+t+e}),{tokenValidationPath:""+t+e.auth.getIn(["config","backend","tokenValidationPath"]),signOutPath:""+t+e.auth.getIn(["config","backend","signOutPath"]),authProviderPaths:r,apiUrl:t}}function u(e){return{key:e.auth.getIn(["config","cookieOptions","key"]),expire:e.auth.getIn(["config","cookieOptions","expire"]),path:e.auth.getIn(["config","cookieOptions","path"])}}function o(e){var t={};return e.auth.getIn(["config","tokenFormat"]).forEach(function(e,r){return t[r]=e}),t}Object.defineProperty(t,"__esModule",{value:!0}),t.getSettings=r},function(e,t){e.exports=require("immutable")},function(e,t){e.exports=require("redux-immutablejs")},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function u(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];return function(t,r){var n=(0,a.getSettings)(r()),u=n.cookieOptions;return i["default"].set(u.key,JSON.stringify(e),{expires:u.expires,path:u.path}),t({type:c,headers:e})}}Object.defineProperty(t,"__esModule",{value:!0}),t.UPDATE_HEADERS=void 0,t.updateHeaders=u;var o=r(16),i=n(o),a=r(1),c=t.UPDATE_HEADERS="UPDATE_HEADERS"},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function u(){return{type:h}}function o(){return{type:p}}function i(e){return{type:v,errors:e}}function a(){return function(e,t){var r=(0,f.getSettings)(t()),n=r.backend;return e(u()),e((0,_.updateHeaders)({})),e((0,s["default"])(n.signOutPath,{method:"delete"})).then(l["default"]).then(function(){return e(o()),Promise.resolve()})["catch"](function(t){return e(i(t)),Promise.reject(t)})}}Object.defineProperty(t,"__esModule",{value:!0}),t.SIGN_OUT_ERROR=t.SIGN_OUT_COMPLETE=t.SIGN_OUT=void 0,t.signOut=a;var c=r(9),s=n(c),f=r(1),d=r(12),l=n(d),_=r(4),h=t.SIGN_OUT="SIGN_OUT",p=t.SIGN_OUT_COMPLETE="SIGN_OUT_COMPLETE",v=t.SIGN_OUT_ERROR="SIGN_OUT_ERROR"},function(e,t){e.exports=require("lodash/keys")},function(e,t){"use strict";function r(){return{type:o}}function n(e){return{type:i,user:e}}function u(e){return{type:a,errors:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.authenticateStart=r,t.authenticateComplete=n,t.authenticateError=u;var o=t.AUTHENTICATE_START="AUTHENTICATE_START",i=t.AUTHENTICATE_COMPLETE="AUTHENTICATE_COMPLETE",a=t.AUTHENTICATE_ERROR="AUTHENTICATE_ERROR"},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function u(e,t){try{var r=e.trim();if(r.length>1&&"{"===r[0]&&"}"===r[r.length-1]){var n=null;try{n=r.substr(1,r.length-2).replace(/\{(.*?)}/g,function(){for(var e=arguments.length,r=Array(e),n=0;n<e;n++)r[n]=arguments[n];var u=t[r[1].trim().toLowerCase()];if(!u)throw"not found";return u})}catch(u){return null}return n}return e}catch(u){return null}}function o(e,t){var r=(0,f["default"])({},e,{"If-Modified-Since":"Mon, 26 Jul 1997 05:00:00 GMT"});return(0,l["default"])(t).forEach(function(n){var o=t[n];if(o&&!r[n]){var i=u(o,e);i&&(r[n]=i)}}),r}function i(e){if(!e||void 0===e)return{};var t=(0,g.getSettings)(e),r=t.cookieOptions,n=t.tokenFormat,u=(0,T.getHeaders)(e);if(!c(u,n))return u;try{return JSON.parse(v["default"].get(r.key)||"{}")}catch(o){return{}}}function a(e,t){if(!e)return{};var r={},n=!0;return(0,l["default"])(t).forEach(function(t){void 0===e[t]?e.get&&e.get(t)&&(r[t]=e.get(t)):r[t]=e[t],r[t]&&((0,h["default"])(r[t])&&(r[t]=r[t][0]),n=!1)}),n?{}:r}function c(e,t){if(!e)return!0;for(var r=(0,l["default"])(t),n=0;n<r.length;++n){var u=r[n],o=void 0;if(void 0===e[u]){if(!e.has||!e.has(u))continue;o=e.get(u)}else o=e[u];if(o&&o.toLowerCase()!==(t[u]||"").toLocaleLowerCase())return!1}return!0}Object.defineProperty(t,"__esModule",{value:!0}),t.evalHeader=u,t.prepareHeadersForFetch=o,t.getHeaders=i,t.parseHeaders=a,t.areHeadersBlank=c;var s=r(10),f=n(s),d=r(6),l=n(d),_=r(31),h=n(_),p=r(16),v=n(p),T=r(21),g=r(1)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return function(r,n){var u=n(),i=(0,f.getSettings)(u),d=i.tokenFormat,l=i.backend;return e.match(l.apiUrl)?(0,o["default"])(e,(0,a["default"])({},t,{headers:(0,c.prepareHeadersForFetch)((0,c.getHeaders)(u),d)})).then(function(e){var t=(0,c.parseHeaders)(e.headers,d);return r((0,s.updateHeaders)(t)),Promise.resolve(e)})["catch"](function(e){return Promise.reject(e)}):(0,o["default"])(e,t).then(function(e){return Promise.resolve(e)})["catch"](function(e){return Promise.reject(e)})}};var u=r(30),o=n(u),i=r(10),a=n(i),c=r(8),s=r(4),f=r(1)},function(e,t){e.exports=require("lodash/assign")},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function u(e){return{type:m,provider:e}}function o(e){var t=e.user,r=e.provider;return{type:P,user:t,provider:r}}function i(e,t){return{type:S,provider:e,errors:t}}function a(e){var t=e.provider,r=e.params;return function(e,n){e(u(t));var a=n(),f=c({provider:t,params:r,state:a});return e(s({provider:t,url:f,state:a})).then(function(r){return e(o({user:r,provider:t}))})["catch"](function(r){var n=r.errors;return e(i(t,n))})}}function c(e){var t=e.provider,r=e.params,n=e.state,u=(0,d.getSettings)(n).backend.authProviderPaths,o=u[t];if(!o)throw"authProviderPath is not set for "+t;var i=o+"?auth_origin_url="+encodeURIComponent(window.location.href);return r&&(0,I["default"])(r).forEach(function(e){return i+="&"+encodeURIComponent(e)+"="+encodeURIComponent(r[e])}),i}function s(e){var t=e.provider,r=e.url,n=e.state,u=e.tab,o=void 0!==u&&u,i=o?"_blank":t,a=(0,O["default"])(t,r,i);return function(e,r){var u=(0,d.getSettings)(r()),o=u.tokenFormat;return new Promise(function(r,u){return e(f({popup:a,provider:t,state:n,resolve:r,reject:u,tokenFormat:o}))})}}function f(e){var t=e.popup,r=e.provider,n=e.state,u=e.resolve,o=e.reject,i=e.tokenFormat;return function(e){var a=null;try{a=(0,E.getAllParams)(t.location,i)}catch(c){console.log(c)}if(!(0,h.areHeadersBlank)(a,i)){var s=(0,d.getSettings)(n).backend.tokenValidationPath;return e((0,p.updateHeaders)((0,E.buildCredentials)(t.location,i))),t.close(),e((0,T["default"])(s)).then(_["default"]).then(function(e){var t=e.data;return u(t)})["catch"](function(e){var t=e.errors;return o({errors:t})})}return t.closed?o({errors:"Authentication was cancelled."}):setTimeout(function(){return e(f({popup:t,provider:r,state:n,resolve:u,reject:o,tokenFormat:i}))},20)}}Object.defineProperty(t,"__esModule",{value:!0}),t.OAUTH_SIGN_IN_ERROR=t.OAUTH_SIGN_IN_COMPLETE=t.OAUTH_SIGN_IN_START=void 0,t.oAuthSignInStart=u,t.oAuthSignInComplete=o,t.oAuthSignInError=i,t.oAuthSignIn=a;var d=r(1),l=r(12),_=n(l),h=r(8),p=r(4),v=r(9),T=n(v),g=r(29),O=n(g),E=r(15),b=r(6),I=n(b),m=t.OAUTH_SIGN_IN_START="OAUTH_SIGN_IN_START",P=t.OAUTH_SIGN_IN_COMPLETE="OAUTH_SIGN_IN_COMPLETE",S=t.OAUTH_SIGN_IN_ERROR="OAUTH_SIGN_IN_ERROR"},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=function(e){var t=e.json();return e.status>=200&&e.status<300?t:t.then(function(e){return Promise.reject(e)})}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function u(e){return{type:I,config:e}}function o(e){if(!e||void 0===e)return null;var t={};return(0,b["default"])(e).forEach(function(r){return t[r.toLowerCase()]=e[r]}),t}function i(e){return{backend:(0,O["default"])({},_["default"],e.backend),tokenFormat:o(e.tokenFormat)||p["default"],cookieOptions:(0,O["default"])({},T["default"],e.cookieOptions),cookies:e.cookies}}function a(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];return function(t,r){if(r().auth.getIn(["user","isSignedIn"]))return Promise.resolve();var n=i(e);if(t(u(n)),n.cookies&&n.cookies[n.cookieOptions.key])try{t((0,d.updateHeaders)(JSON.parse(n.cookies[n.cookieOptions.key])))}catch(o){t((0,d.updateHeaders)())}return e.currentLocation&&e.currentLocation.match(/blank=true/)?Promise.resolve({blank:!0}):t((0,s["default"])(e.currentLocation)).then(function(e){var r=e.user;return t((0,f.authenticateComplete)(r)),Promise.resolve()})["catch"](function(e){var r=e.errors;return t((0,d.updateHeaders)()),t((0,f.authenticateError)(r)),Promise.resolve()})}}Object.defineProperty(t,"__esModule",{value:!0}),t.AUTH_INIT_SETTINGS=void 0,t.initialize=a;var c=r(14),s=n(c),f=r(7),d=r(4),l=r(17),_=n(l),h=r(19),p=n(h),v=r(18),T=n(v),g=r(10),O=n(g),E=r(6),b=n(E),I=t.AUTH_INIT_SETTINGS="AUTH_INIT_SETTINGS"},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=function(e){return function(t,r){var n=r(),u=(0,i.getHeaders)(n),c=(0,a.getSettings)(n),f=c.backend,_=c.tokenFormat,p=(0,d["default"])(o["default"].parse(e),_),v=p.authRedirectHeaders;if((0,i.areHeadersBlank)(v,_)||(u=(0,i.parseHeaders)(v,_)),0===(0,h["default"])(u).length)return Promise.reject({reason:"No creds"});var T=f.tokenValidationPath+"?unbatch=true";return t((0,l.authenticateStart)()),t((0,s["default"])(T)).then(function(e){return e.json()}).then(function(e){return e.success?Promise.resolve({user:e.data}):Promise.reject({errors:e.errors})})}};var u=r(35),o=n(u),i=r(8),a=r(1),c=r(9),s=n(c),f=r(15),d=n(f),l=r(7),_=r(6),h=n(_)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function u(e){var t=e.anchor||"",r=t.split("?");return r.length>1?r[1]:null}function o(e){var t=e.search||"",r=t.replace("?","");return r?d["default"].parse(r):{}}function i(e){var t=u(e);return t?d["default"].parse(t):{}}function a(e){return(0,_["default"])({},i(e),o(e))}function c(e,t){var r=a(e),n={};return(0,p["default"])(t).forEach(function(e){if(r[e])n[e]=r[e];else{var u=(0,E.evalHeader)(t[e],r);(0,O["default"])(u)||(n[e]=u)}}),n}function s(e,t){var r=d["default"].stringify((0,T["default"])(o(e),t)),n=d["default"].stringify((0,T["default"])(i(e),t)),u=(e.hash||"").split("?")[0];return r&&(r="?"+r),n&&(u+="?"+n),u&&!u.match(/^#/)&&(u="#/"+u),e.pathname+r+u}Object.defineProperty(t,"__esModule",{value:!0}),t.getAllParams=a,t.buildCredentials=c,t["default"]=function(e,t){if(!e)return{};var r=c(e,t),n=s(e,(0,p["default"])(t));return n!==e?{authRedirectHeaders:r,authRedirectPath:n}:{}};var f=r(34),d=n(f),l=r(10),_=n(l),h=r(6),p=n(h),v=r(33),T=n(v),g=r(32),O=n(g),E=r(8)},function(e,t){e.exports=require("js-cookie")},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]={tokenValidationPath:"/auth/validate_token",signOutPath:"/auth/sign_out",authProviderPaths:{}}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]={key:"authHeaders",path:"/",expire:14}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]={"access-token":"{{ auth_token }}","token-type":"Bearer",client:"{{ client_id }}",expiry:null,uid:null,authorization:"{{ token-type } { access-token }}"}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0}),t.OAUTH_SIGN_IN_ERROR=t.OAUTH_SIGN_IN_COMPLETE=t.OAUTH_SIGN_IN_START=t.AUTHENTICATE_ERROR=t.AUTHENTICATE_COMPLETE=t.AUTHENTICATE_START=t.verifyAuth=t.UPDATE_HEADERS=t.updateHeaders=t.oAuthSignIn=t.authenticateError=t.authenticateComplete=t.authenticateStart=t.SIGN_OUT_ERROR=t.SIGN_OUT_COMPLETE=t.SIGN_OUT=t.signOut=t.initialize=t.parseResponse=t.getHeaders=t.fetch=t.authStateReducer=void 0;var u=r(8);Object.defineProperty(t,"getHeaders",{enumerable:!0,get:function(){return u.getHeaders}});var o=r(13);Object.defineProperty(t,"initialize",{enumerable:!0,get:function(){return o.initialize}});var i=r(5);Object.defineProperty(t,"signOut",{enumerable:!0,get:function(){return i.signOut}}),Object.defineProperty(t,"SIGN_OUT",{enumerable:!0,get:function(){return i.SIGN_OUT}}),Object.defineProperty(t,"SIGN_OUT_COMPLETE",{enumerable:!0,get:function(){return i.SIGN_OUT_COMPLETE}}),Object.defineProperty(t,"SIGN_OUT_ERROR",{enumerable:!0,get:function(){return i.SIGN_OUT_ERROR}});var a=r(7);Object.defineProperty(t,"authenticateStart",{enumerable:!0,get:function(){return a.authenticateStart}}),Object.defineProperty(t,"authenticateComplete",{enumerable:!0,get:function(){return a.authenticateComplete}}),Object.defineProperty(t,"authenticateError",{enumerable:!0,get:function(){return a.authenticateError}});var c=r(11);Object.defineProperty(t,"oAuthSignIn",{enumerable:!0,get:function(){return c.oAuthSignIn}});var s=r(4);Object.defineProperty(t,"updateHeaders",{enumerable:!0,get:function(){return s.updateHeaders}}),Object.defineProperty(t,"UPDATE_HEADERS",{enumerable:!0,get:function(){return s.UPDATE_HEADERS}}),Object.defineProperty(t,"AUTHENTICATE_START",{enumerable:!0,get:function(){return a.AUTHENTICATE_START}}),Object.defineProperty(t,"AUTHENTICATE_COMPLETE",{enumerable:!0,get:function(){return a.AUTHENTICATE_COMPLETE}}),Object.defineProperty(t,"AUTHENTICATE_ERROR",{enumerable:!0,get:function(){return a.AUTHENTICATE_ERROR}}),Object.defineProperty(t,"OAUTH_SIGN_IN_START",{enumerable:!0,get:function(){return c.OAUTH_SIGN_IN_START}}),Object.defineProperty(t,"OAUTH_SIGN_IN_COMPLETE",{enumerable:!0,get:function(){return c.OAUTH_SIGN_IN_COMPLETE}}),Object.defineProperty(t,"OAUTH_SIGN_IN_ERROR",{enumerable:!0,get:function(){return c.OAUTH_SIGN_IN_ERROR}});var f=r(25),d=n(f),l=r(9),_=n(l),h=r(12),p=n(h),v=r(14),T=n(v);t.authStateReducer=d["default"],t.fetch=_["default"],t.parseResponse=p["default"],t.verifyAuth=T["default"]},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function u(e){var t=(0,o.getSettings)(e),r=t.tokenFormat,n={};return(0,a["default"])(r).forEach(function(t){var r=e.auth.getIn(["headers",t]);r&&(n[t]=r)}),n}Object.defineProperty(t,"__esModule",{value:!0}),t.getHeaders=u;var o=r(1),i=r(6),a=n(i)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Object.defineProperty(t,"__esModule",{value:!0});var o,i=r(2),a=n(i),c=r(3),s=r(7),f=r(5),d=a["default"].fromJS({loading:!1,valid:!1,errors:null});t["default"]=(0,c.createReducer)(d,(o={},u(o,s.AUTHENTICATE_COMPLETE,function(e){return e.merge({loading:!1,errors:null,valid:!0})}),u(o,s.AUTHENTICATE_ERROR,function(e){return e.merge({loading:!1,errors:"Invalid token",valid:!1})}),u(o,f.SIGN_OUT,function(){return d}),o))},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},i=r(2),a=n(i),c=r(3),s=r(13),f=a["default"].fromJS({});t["default"]=(0,c.createReducer)(f,u({},s.AUTH_INIT_SETTINGS,function(e,t){var r=t.config;return e.mergeDeep(o({},r))}))},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Object.defineProperty(t,"__esModule",{value:!0});var o,i=r(2),a=n(i),c=r(3),s=r(4),f=r(5),d=a["default"].fromJS({});t["default"]=(0,c.createReducer)(d,(o={},u(o,s.UPDATE_HEADERS,function(e,t){var r=t.headers;return e.merge(r)}),u(o,f.SIGN_OUT,function(){return d}),o))},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var u=r(3),o=r(2),i=n(o),a=r(22),c=n(a),s=r(28),f=n(s),d=r(26),l=n(d),_=r(24),h=n(_),p=r(27),v=n(p),T=r(23),g=n(T),O=(0,u.combineReducers)({signOut:v["default"],authentication:c["default"],oAuthSignIn:l["default"],headers:h["default"],user:f["default"],config:g["default"]});t["default"]=function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=arguments[1];return i["default"].Iterable.isIterable(e)?O(e,t):O(i["default"].fromJS(e),t)}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Object.defineProperty(t,"__esModule",{value:!0});var o,i=r(2),a=n(i),c=r(3),s=r(11),f=r(5),d=a["default"].fromJS({loading:!1,errors:null});t["default"]=(0,c.createReducer)(d,(o={},u(o,s.OAUTH_SIGN_IN_START,function(e,t){var r=t.provider;return e.setIn([r,"loading"],!0)}),u(o,s.OAUTH_SIGN_IN_COMPLETE,function(e,t){var r=t.provider;return e.mergeDeep(u({},r,{loading:!1,errors:null}))}),u(o,s.OAUTH_SIGN_IN_ERROR,function(e,t){var r=t.provider,n=t.errors;return e.mergeDeep(u({},r,{loading:!1,errors:n}))}),u(o,f.SIGN_OUT,function(){return d}),o))},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Object.defineProperty(t,"__esModule",{value:!0});var o,i=r(2),a=n(i),c=r(3),s=r(5),f=a["default"].fromJS({loading:!1,errors:null});t["default"]=(0,c.createReducer)(f,(o={},u(o,s.SIGN_OUT,function(e){return e.setIn(["loading"],!0)}),u(o,s.SIGN_OUT_COMPLETE,function(e){return e.mergeDeep({loading:!1,errors:null})}),u(o,s.SIGN_OUT_ERROR,function(e,t){var r=t.errors;return e.mergeDeep({loading:!1,errors:r})}),o))},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Object.defineProperty(t,"__esModule",{value:!0});var o,i=r(2),a=n(i),c=r(3),s=r(7),f=r(11),d=r(5),l=a["default"].fromJS({attributes:null,isSignedIn:!1});t["default"]=(0,c.createReducer)(l,(o={},u(o,s.AUTHENTICATE_COMPLETE,function(e,t){var r=t.user;return e.merge({attributes:r,isSignedIn:!0})}),u(o,f.OAUTH_SIGN_IN_COMPLETE,function(e,t){var r=t.user;return e.merge({attributes:r,isSignedIn:!0})}),u(o,s.AUTHENTICATE_ERROR,function(e){return e.merge(l)}),u(o,d.SIGN_OUT,function(){return l}),o))},function(e,t){"use strict";function r(e){var t=e.width,r=e.height,n=window.screenLeft?window.screenLeft:window.screenX,u=window.screenTop?window.screenTop:window.screenY,o=n+window.innerWidth/2-t/2,i=u+window.innerHeight/2-r/2;return{top:i,left:o}}function n(e){switch(e){case"facebook":return{width:580,height:400};case"google":return{width:452,height:633};case"github":return{width:1020,height:618};case"linkedin":return{width:527,height:582};case"twitter":return{width:495,height:645};case"live":return{width:500,height:560};case"yahoo":return{width:559,height:519};default:return{width:1020,height:618}}}function u(e){var t=n(e),u=t.width,o=t.height,i=r({width:u,height:o}),a=i.top,c=i.left;return"width="+u+",height="+o+",top="+a+",left="+c}Object.defineProperty(t,"__esModule",{value:!0});var o="scrollbars=no,toolbar=no,location=no,titlebar=no,directories=no,status=no,menubar=no";t["default"]=function(e,t,r){return window.open(t,r,o+","+u(e))}},function(e,t){e.exports=require("isomorphic-fetch")},function(e,t){e.exports=require("lodash/isArray")},function(e,t){e.exports=require("lodash/isNull")},function(e,t){e.exports=require("lodash/omit")},function(e,t){e.exports=require("querystring")},function(e,t){e.exports=require("url")}])});
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("immutable"),require("redux-immutablejs"),require("lodash/keys"),require("lodash/assign"),require("js-cookie"),require("isomorphic-fetch"),require("lodash/isArray"),require("lodash/isNull"),require("lodash/omit"),require("querystring"),require("url"));else if("function"==typeof define&&define.amd)define(["immutable","redux-immutablejs","lodash/keys","lodash/assign","js-cookie","isomorphic-fetch","lodash/isArray","lodash/isNull","lodash/omit","querystring","url"],t);else{var r="object"==typeof exports?t(require("immutable"),require("redux-immutablejs"),require("lodash/keys"),require("lodash/assign"),require("js-cookie"),require("isomorphic-fetch"),require("lodash/isArray"),require("lodash/isNull"),require("lodash/omit"),require("querystring"),require("url")):t(e.immutable,e["redux-immutablejs"],e["lodash/keys"],e["lodash/assign"],e["js-cookie"],e["isomorphic-fetch"],e["lodash/isArray"],e["lodash/isNull"],e["lodash/omit"],e.querystring,e.url);for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(this,function(e,t,r,n,u,o,i,a,c,s,f){return function(e){function t(n){if(r[n])return r[n].exports;var u=r[n]={exports:{},id:n,loaded:!1};return e[n].call(u.exports,u,u.exports,t),u.loaded=!0,u.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){e.exports=r(20)},function(e,t){"use strict";function r(e){return{backend:n(e),cookieOptions:u(e),tokenFormat:o(e)}}function n(e){var t=""+e.auth.getIn(["config","backend","apiUrl"]),r={};e.auth.getIn(["config","backend","authProviderPaths"]).forEach(function(e,n){return r[n]=""+t+e});var n=e.auth.getIn(["config","backend","signOutPath"]),u=n?""+t+n:null;return{tokenValidationPath:""+t+e.auth.getIn(["config","backend","tokenValidationPath"]),signOutPath:u,authProviderPaths:r,apiUrl:t}}function u(e){return{key:e.auth.getIn(["config","cookieOptions","key"]),expire:e.auth.getIn(["config","cookieOptions","expire"]),path:e.auth.getIn(["config","cookieOptions","path"])}}function o(e){var t={};return e.auth.getIn(["config","tokenFormat"]).forEach(function(e,r){return t[r]=e}),t}Object.defineProperty(t,"__esModule",{value:!0}),t.getSettings=r},function(e,t){e.exports=require("immutable")},function(e,t){e.exports=require("redux-immutablejs")},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function u(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];return function(t,r){var n=(0,a.getSettings)(r()),u=n.cookieOptions;return i["default"].set(u.key,JSON.stringify(e),{expires:u.expires,path:u.path}),t({type:c,headers:e})}}Object.defineProperty(t,"__esModule",{value:!0}),t.UPDATE_HEADERS=void 0,t.updateHeaders=u;var o=r(16),i=n(o),a=r(1),c=t.UPDATE_HEADERS="UPDATE_HEADERS"},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function u(){return{type:h}}function o(){return{type:p}}function i(e){return{type:v,errors:e}}function a(){return function(e,t){var r=(0,f.getSettings)(t()),n=r.backend;return e(u()),e((0,_.updateHeaders)()),n.signOutPath?e((0,s["default"])(n.signOutPath,{method:"delete"})).then(d["default"]).then(function(){return e(o()),Promise.resolve()})["catch"](function(t){return e(i(t)),Promise.reject(t)}):(e(o()),Promise.resolve())}}Object.defineProperty(t,"__esModule",{value:!0}),t.SIGN_OUT_ERROR=t.SIGN_OUT_COMPLETE=t.SIGN_OUT=void 0,t.signOut=a;var c=r(9),s=n(c),f=r(1),l=r(12),d=n(l),_=r(4),h=t.SIGN_OUT="SIGN_OUT",p=t.SIGN_OUT_COMPLETE="SIGN_OUT_COMPLETE",v=t.SIGN_OUT_ERROR="SIGN_OUT_ERROR"},function(e,t){e.exports=require("lodash/keys")},function(e,t){"use strict";function r(){return{type:o}}function n(e){return{type:i,user:e}}function u(e){return{type:a,errors:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.authenticateStart=r,t.authenticateComplete=n,t.authenticateError=u;var o=t.AUTHENTICATE_START="AUTHENTICATE_START",i=t.AUTHENTICATE_COMPLETE="AUTHENTICATE_COMPLETE",a=t.AUTHENTICATE_ERROR="AUTHENTICATE_ERROR"},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function u(e,t){try{var r=e.trim();if(r.length>1&&"{"===r[0]&&"}"===r[r.length-1]){var n=null;try{n=r.substr(1,r.length-2).replace(/\{(.*?)}/g,function(){for(var e=arguments.length,r=Array(e),n=0;n<e;n++)r[n]=arguments[n];var u=t[r[1].trim().toLowerCase()];if(!u)throw"not found";return u})}catch(u){return null}return n}return e}catch(u){return null}}function o(e,t){var r=(0,f["default"])({},e,{"If-Modified-Since":"Mon, 26 Jul 1997 05:00:00 GMT"});return(0,d["default"])(t).forEach(function(n){var o=t[n];if(o&&!r[n]){var i=u(o,e);i&&(r[n]=i)}}),r}function i(e){if(!e||void 0===e)return{};var t=(0,g.getSettings)(e),r=t.cookieOptions,n=t.tokenFormat,u=(0,T.getHeaders)(e);if(!c(u,n))return u;try{return JSON.parse(v["default"].get(r.key)||"{}")}catch(o){return{}}}function a(e,t){if(!e)return{};var r={},n=!0;return(0,d["default"])(t).forEach(function(t){void 0===e[t]?e.get&&e.get(t)&&(r[t]=e.get(t)):r[t]=e[t],r[t]&&((0,h["default"])(r[t])&&(r[t]=r[t][0]),n=!1)}),n?{}:r}function c(e,t){if(!e)return!0;for(var r=(0,d["default"])(t),n=0;n<r.length;++n){var u=r[n],o=void 0;if(void 0===e[u]){if(!e.has||!e.has(u))continue;o=e.get(u)}else o=e[u];if(o&&o.toLowerCase()!==(t[u]||"").toLocaleLowerCase())return!1}return!0}Object.defineProperty(t,"__esModule",{value:!0}),t.evalHeader=u,t.prepareHeadersForFetch=o,t.getHeaders=i,t.parseHeaders=a,t.areHeadersBlank=c;var s=r(10),f=n(s),l=r(6),d=n(l),_=r(31),h=n(_),p=r(16),v=n(p),T=r(21),g=r(1)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return function(r,n){var u=n(),i=(0,s.getSettings)(u),l=i.tokenFormat,d=i.backend;return e.match(d.apiUrl)?(0,o["default"])(e,(0,a["default"])({},t,{headers:(0,f.prepareHeadersForFetch)((0,f.getHeaders)(u),l)})).then(function(e){var t=(0,f.parseHeaders)(e.headers,l);return(0,f.areHeadersBlank)(t,l)||r((0,c.updateHeaders)(t)),Promise.resolve(e)})["catch"](function(e){return Promise.reject(e)}):(0,o["default"])(e,t).then(function(e){return Promise.resolve(e)})["catch"](function(e){return Promise.reject(e)})}};var u=r(30),o=n(u),i=r(10),a=n(i),c=r(4),s=r(1),f=r(8)},function(e,t){e.exports=require("lodash/assign")},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function u(e){return{type:m,provider:e}}function o(e){var t=e.user,r=e.provider;return{type:P,user:t,provider:r}}function i(e,t){return{type:S,provider:e,errors:t}}function a(e){var t=e.provider,r=e.params;return function(e,n){e(u(t));var a=n(),f=c({provider:t,params:r,state:a});return e(s({provider:t,url:f,state:a})).then(function(r){return e(o({user:r,provider:t}))})["catch"](function(r){var n=r.errors;return e(i(t,n))})}}function c(e){var t=e.provider,r=e.params,n=e.state,u=(0,l.getSettings)(n).backend.authProviderPaths,o=u[t];if(!o)throw"authProviderPath is not set for "+t;var i=o+"?auth_origin_url="+encodeURIComponent(window.location.href);return r&&(0,I["default"])(r).forEach(function(e){return i+="&"+encodeURIComponent(e)+"="+encodeURIComponent(r[e])}),i}function s(e){var t=e.provider,r=e.url,n=e.state,u=e.tab,o=void 0!==u&&u,i=o?"_blank":t,a=(0,O["default"])(t,r,i);return function(e,r){var u=(0,l.getSettings)(r()),o=u.tokenFormat;return new Promise(function(r,u){return e(f({popup:a,provider:t,state:n,resolve:r,reject:u,tokenFormat:o}))})}}function f(e){var t=e.popup,r=e.provider,n=e.state,u=e.resolve,o=e.reject,i=e.tokenFormat;return function(e){var a=null;try{a=(0,E.getAllParams)(t.location,i)}catch(c){}if(!(0,h.areHeadersBlank)(a,i)){var s=(0,l.getSettings)(n).backend.tokenValidationPath;return e((0,p.updateHeaders)((0,E.buildCredentials)(t.location,i))),t.close(),e((0,T["default"])(s)).then(_["default"]).then(function(e){var t=e.data;return u(t)})["catch"](function(e){var t=e.errors;return o({errors:t})})}return t.closed?o({errors:"Authentication was cancelled."}):setTimeout(function(){return e(f({popup:t,provider:r,state:n,resolve:u,reject:o,tokenFormat:i}))},20)}}Object.defineProperty(t,"__esModule",{value:!0}),t.OAUTH_SIGN_IN_ERROR=t.OAUTH_SIGN_IN_COMPLETE=t.OAUTH_SIGN_IN_START=void 0,t.oAuthSignInStart=u,t.oAuthSignInComplete=o,t.oAuthSignInError=i,t.oAuthSignIn=a;var l=r(1),d=r(12),_=n(d),h=r(8),p=r(4),v=r(9),T=n(v),g=r(29),O=n(g),E=r(15),b=r(6),I=n(b),m=t.OAUTH_SIGN_IN_START="OAUTH_SIGN_IN_START",P=t.OAUTH_SIGN_IN_COMPLETE="OAUTH_SIGN_IN_COMPLETE",S=t.OAUTH_SIGN_IN_ERROR="OAUTH_SIGN_IN_ERROR"},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=function(e){var t=e.json();return e.status>=200&&e.status<300?t:t.then(function(e){return Promise.reject(e)})}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function u(e){return{type:I,config:e}}function o(e){if(!e||void 0===e)return null;var t={};return(0,b["default"])(e).forEach(function(r){return t[r.toLowerCase()]=e[r]}),t}function i(e){return{backend:(0,O["default"])({},_["default"],e.backend),tokenFormat:o(e.tokenFormat)||p["default"],cookieOptions:(0,O["default"])({},T["default"],e.cookieOptions),cookies:e.cookies}}function a(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];return function(t,r){if(r().auth.getIn(["user","isSignedIn"]))return Promise.resolve();var n=i(e);if(t(u(n)),n.cookies&&n.cookies[n.cookieOptions.key])try{t((0,l.updateHeaders)(JSON.parse(n.cookies[n.cookieOptions.key])))}catch(o){t((0,l.updateHeaders)())}return e.currentLocation&&e.currentLocation.match(/blank=true/)?Promise.resolve({blank:!0}):t((0,s["default"])(e.currentLocation)).then(function(e){var r=e.user;return t((0,f.authenticateComplete)(r)),Promise.resolve()})["catch"](function(e){var r=e.errors;return t((0,l.updateHeaders)()),t((0,f.authenticateError)(r)),Promise.resolve()})}}Object.defineProperty(t,"__esModule",{value:!0}),t.AUTH_INIT_SETTINGS=void 0,t.initialize=a;var c=r(14),s=n(c),f=r(7),l=r(4),d=r(17),_=n(d),h=r(19),p=n(h),v=r(18),T=n(v),g=r(10),O=n(g),E=r(6),b=n(E),I=t.AUTH_INIT_SETTINGS="AUTH_INIT_SETTINGS"},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=function(e){return function(t,r){var n=r(),u=(0,i.getHeaders)(n),c=(0,a.getSettings)(n),f=c.backend,_=c.tokenFormat,p=(0,l["default"])(o["default"].parse(e),_),v=p.authRedirectHeaders;if((0,i.areHeadersBlank)(v,_)||(u=(0,i.parseHeaders)(v,_)),0===(0,h["default"])(u).length)return Promise.reject({reason:"No creds"});var T=f.tokenValidationPath+"?unbatch=true";return t((0,d.authenticateStart)()),t((0,s["default"])(T)).then(function(e){return e.json()}).then(function(e){return e.success?Promise.resolve({user:e.data}):Promise.reject({errors:e.errors})})}};var u=r(35),o=n(u),i=r(8),a=r(1),c=r(9),s=n(c),f=r(15),l=n(f),d=r(7),_=r(6),h=n(_)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function u(e){var t=e.anchor||"",r=t.split("?");return r.length>1?r[1]:null}function o(e){var t=e.search||"",r=t.replace("?","");return r?l["default"].parse(r):{}}function i(e){var t=u(e);return t?l["default"].parse(t):{}}function a(e){return(0,_["default"])({},i(e),o(e))}function c(e,t){var r=a(e),n={};return(0,p["default"])(t).forEach(function(e){if(r[e])n[e]=r[e];else{var u=(0,E.evalHeader)(t[e],r);(0,O["default"])(u)||(n[e]=u)}}),n}function s(e,t){var r=l["default"].stringify((0,T["default"])(o(e),t)),n=l["default"].stringify((0,T["default"])(i(e),t)),u=(e.hash||"").split("?")[0];return r&&(r="?"+r),n&&(u+="?"+n),u&&!u.match(/^#/)&&(u="#/"+u),e.pathname+r+u}Object.defineProperty(t,"__esModule",{value:!0}),t.getAllParams=a,t.buildCredentials=c,t["default"]=function(e,t){if(!e)return{};var r=c(e,t),n=s(e,(0,p["default"])(t));return n!==e?{authRedirectHeaders:r,authRedirectPath:n}:{}};var f=r(34),l=n(f),d=r(10),_=n(d),h=r(6),p=n(h),v=r(33),T=n(v),g=r(32),O=n(g),E=r(8)},function(e,t){e.exports=require("js-cookie")},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]={tokenValidationPath:"/auth/validate_token",signOutPath:"/auth/sign_out",authProviderPaths:{}}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]={key:"authHeaders",path:"/",expire:14}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]={"access-token":"{{ auth_token }}","token-type":"Bearer",client:"{{ client_id }}",expiry:null,uid:null,authorization:"{{ token-type } { access-token }}"}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0}),t.OAUTH_SIGN_IN_ERROR=t.OAUTH_SIGN_IN_COMPLETE=t.OAUTH_SIGN_IN_START=t.AUTHENTICATE_ERROR=t.AUTHENTICATE_COMPLETE=t.AUTHENTICATE_START=t.verifyAuth=t.UPDATE_HEADERS=t.updateHeaders=t.oAuthSignIn=t.authenticateError=t.authenticateComplete=t.authenticateStart=t.SIGN_OUT_ERROR=t.SIGN_OUT_COMPLETE=t.SIGN_OUT=t.signOut=t.initialize=t.parseResponse=t.getHeaders=t.fetch=t.authStateReducer=void 0;var u=r(8);Object.defineProperty(t,"getHeaders",{enumerable:!0,get:function(){return u.getHeaders}});var o=r(13);Object.defineProperty(t,"initialize",{enumerable:!0,get:function(){return o.initialize}});var i=r(5);Object.defineProperty(t,"signOut",{enumerable:!0,get:function(){return i.signOut}}),Object.defineProperty(t,"SIGN_OUT",{enumerable:!0,get:function(){return i.SIGN_OUT}}),Object.defineProperty(t,"SIGN_OUT_COMPLETE",{enumerable:!0,get:function(){return i.SIGN_OUT_COMPLETE}}),Object.defineProperty(t,"SIGN_OUT_ERROR",{enumerable:!0,get:function(){return i.SIGN_OUT_ERROR}});var a=r(7);Object.defineProperty(t,"authenticateStart",{enumerable:!0,get:function(){return a.authenticateStart}}),Object.defineProperty(t,"authenticateComplete",{enumerable:!0,get:function(){return a.authenticateComplete}}),Object.defineProperty(t,"authenticateError",{enumerable:!0,get:function(){return a.authenticateError}});var c=r(11);Object.defineProperty(t,"oAuthSignIn",{enumerable:!0,get:function(){return c.oAuthSignIn}});var s=r(4);Object.defineProperty(t,"updateHeaders",{enumerable:!0,get:function(){return s.updateHeaders}}),Object.defineProperty(t,"UPDATE_HEADERS",{enumerable:!0,get:function(){return s.UPDATE_HEADERS}}),Object.defineProperty(t,"AUTHENTICATE_START",{enumerable:!0,get:function(){return a.AUTHENTICATE_START}}),Object.defineProperty(t,"AUTHENTICATE_COMPLETE",{enumerable:!0,get:function(){return a.AUTHENTICATE_COMPLETE}}),Object.defineProperty(t,"AUTHENTICATE_ERROR",{enumerable:!0,get:function(){return a.AUTHENTICATE_ERROR}}),Object.defineProperty(t,"OAUTH_SIGN_IN_START",{enumerable:!0,get:function(){return c.OAUTH_SIGN_IN_START}}),Object.defineProperty(t,"OAUTH_SIGN_IN_COMPLETE",{enumerable:!0,get:function(){return c.OAUTH_SIGN_IN_COMPLETE}}),Object.defineProperty(t,"OAUTH_SIGN_IN_ERROR",{enumerable:!0,get:function(){return c.OAUTH_SIGN_IN_ERROR}});var f=r(25),l=n(f),d=r(9),_=n(d),h=r(12),p=n(h),v=r(14),T=n(v);t.authStateReducer=l["default"],t.fetch=_["default"],t.parseResponse=p["default"],t.verifyAuth=T["default"]},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function u(e){var t=(0,o.getSettings)(e),r=t.tokenFormat,n={};return(0,a["default"])(r).forEach(function(t){var r=e.auth.getIn(["headers",t]);r&&(n[t]=r)}),n}Object.defineProperty(t,"__esModule",{value:!0}),t.getHeaders=u;var o=r(1),i=r(6),a=n(i)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Object.defineProperty(t,"__esModule",{value:!0});var o,i=r(2),a=n(i),c=r(3),s=r(7),f=r(5),l=a["default"].fromJS({loading:!1,valid:!1,errors:null});t["default"]=(0,c.createReducer)(l,(o={},u(o,s.AUTHENTICATE_COMPLETE,function(e){return e.merge({loading:!1,errors:null,valid:!0})}),u(o,s.AUTHENTICATE_ERROR,function(e){return e.merge({loading:!1,errors:"Invalid token",valid:!1})}),u(o,f.SIGN_OUT,function(){return l}),o))},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},i=r(2),a=n(i),c=r(3),s=r(13),f=a["default"].fromJS({});t["default"]=(0,c.createReducer)(f,u({},s.AUTH_INIT_SETTINGS,function(e,t){var r=t.config;return e.mergeDeep(o({},r))}))},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Object.defineProperty(t,"__esModule",{value:!0});var o,i=r(2),a=n(i),c=r(3),s=r(4),f=r(5),l=a["default"].fromJS({});t["default"]=(0,c.createReducer)(l,(o={},u(o,s.UPDATE_HEADERS,function(e,t){var r=t.headers;return e.merge(r)}),u(o,f.SIGN_OUT,function(){return l}),o))},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var u=r(3),o=r(2),i=n(o),a=r(22),c=n(a),s=r(28),f=n(s),l=r(26),d=n(l),_=r(24),h=n(_),p=r(27),v=n(p),T=r(23),g=n(T),O=(0,u.combineReducers)({signOut:v["default"],authentication:c["default"],oAuthSignIn:d["default"],headers:h["default"],user:f["default"],config:g["default"]});t["default"]=function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=arguments[1];return i["default"].Iterable.isIterable(e)?O(e,t):O(i["default"].fromJS(e),t)}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Object.defineProperty(t,"__esModule",{value:!0});var o,i=r(2),a=n(i),c=r(3),s=r(11),f=r(5),l=a["default"].fromJS({loading:!1,errors:null});t["default"]=(0,c.createReducer)(l,(o={},u(o,s.OAUTH_SIGN_IN_START,function(e,t){var r=t.provider;return e.setIn([r,"loading"],!0)}),u(o,s.OAUTH_SIGN_IN_COMPLETE,function(e,t){var r=t.provider;return e.mergeDeep(u({},r,{loading:!1,errors:null}))}),u(o,s.OAUTH_SIGN_IN_ERROR,function(e,t){var r=t.provider,n=t.errors;return e.mergeDeep(u({},r,{loading:!1,errors:n}))}),u(o,f.SIGN_OUT,function(){return l}),o))},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Object.defineProperty(t,"__esModule",{value:!0});var o,i=r(2),a=n(i),c=r(3),s=r(5),f=a["default"].fromJS({loading:!1,errors:null});t["default"]=(0,c.createReducer)(f,(o={},u(o,s.SIGN_OUT,function(e){return e.setIn(["loading"],!0)}),u(o,s.SIGN_OUT_COMPLETE,function(e){return e.mergeDeep({loading:!1,errors:null})}),u(o,s.SIGN_OUT_ERROR,function(e,t){var r=t.errors;return e.mergeDeep({loading:!1,errors:r})}),o))},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Object.defineProperty(t,"__esModule",{value:!0});var o,i=r(2),a=n(i),c=r(3),s=r(7),f=r(11),l=r(5),d=a["default"].fromJS({attributes:null,isSignedIn:!1});t["default"]=(0,c.createReducer)(d,(o={},u(o,s.AUTHENTICATE_COMPLETE,function(e,t){var r=t.user;return e.merge({attributes:r,isSignedIn:!0})}),u(o,f.OAUTH_SIGN_IN_COMPLETE,function(e,t){var r=t.user;return e.merge({attributes:r,isSignedIn:!0})}),u(o,s.AUTHENTICATE_ERROR,function(e){return e.merge(d)}),u(o,l.SIGN_OUT,function(){return d}),o))},function(e,t){"use strict";function r(e){var t=e.width,r=e.height,n=window.screenLeft?window.screenLeft:window.screenX,u=window.screenTop?window.screenTop:window.screenY,o=n+window.innerWidth/2-t/2,i=u+window.innerHeight/2-r/2;return{top:i,left:o}}function n(e){switch(e){case"facebook":return{width:580,height:400};case"google":return{width:452,height:633};case"github":return{width:1020,height:618};case"linkedin":return{width:527,height:582};case"twitter":return{width:495,height:645};case"live":return{width:500,height:560};case"yahoo":return{width:559,height:519};default:return{width:1020,height:618}}}function u(e){var t=n(e),u=t.width,o=t.height,i=r({width:u,height:o}),a=i.top,c=i.left;return"width="+u+",height="+o+",top="+a+",left="+c}Object.defineProperty(t,"__esModule",{value:!0});var o="scrollbars=no,toolbar=no,location=no,titlebar=no,directories=no,status=no,menubar=no";t["default"]=function(e,t,r){return window.open(t,r,o+","+u(e))}},function(e,t){e.exports=require("isomorphic-fetch")},function(e,t){e.exports=require("lodash/isArray")},function(e,t){e.exports=require("lodash/isNull")},function(e,t){e.exports=require("lodash/omit")},function(e,t){e.exports=require("querystring")},function(e,t){e.exports=require("url")}])});
{
"name": "redux-oauth",
"description": "Bearer token-based authentication system for redux with OAuth2 support",
"version": "2.0.2",
"version": "2.0.3",
"license": "MIT",

@@ -6,0 +6,0 @@ "repository": {

import { getSettings } from 'models/settings';
import parseResponse from 'utils/parseResponse';
import { parseHeaders, areHeadersBlank } from 'utils/headers';
import { areHeadersBlank } from 'utils/headers';
import { updateHeaders } from './headers';

@@ -75,5 +75,3 @@ import fetch from 'utils/fetch';

creds = getAllParams(popup.location, tokenFormat);
} catch (err) {
console.log(err);
}
} catch (err) {}

@@ -80,0 +78,0 @@ if (!areHeadersBlank(creds, tokenFormat)) {

@@ -28,4 +28,10 @@ import fetch from 'utils/fetch';

dispatch(signOutStart());
dispatch(updateHeaders({}));
dispatch(updateHeaders());
if (!backend.signOutPath) {
dispatch(signOutComplete());
return Promise.resolve();
}
return dispatch(fetch(backend.signOutPath, { method: 'delete' }))

@@ -32,0 +38,0 @@ .then(parseResponse)

@@ -16,5 +16,9 @@ export function getSettings(state) {

const signOutPart = state.auth.getIn(['config', 'backend', 'signOutPath']);
const signOutPath = signOutPart ? `${apiUrl}${signOutPart}` : null;
return {
tokenValidationPath: `${apiUrl}${state.auth.getIn(['config', 'backend', 'tokenValidationPath'])}`,
signOutPath: `${apiUrl}${state.auth.getIn(['config', 'backend', 'signOutPath'])}`,
signOutPath,
authProviderPaths,

@@ -21,0 +25,0 @@ apiUrl

import { combineReducers } from 'redux-immutablejs';
import Immutable from "immutable";
import Immutable from 'immutable';

@@ -26,2 +26,2 @@ import authentication from './authenticate';

return reducer(state, action);
}
};

@@ -1,7 +0,13 @@

import originalFetch from 'isomorphic-fetch';
import assign from 'lodash/assign';
import { parseHeaders, getHeaders, prepareHeadersForFetch } from 'utils/headers';
import { updateHeaders } from 'actions/headers';
import { getSettings } from 'models/settings';
import originalFetch from 'isomorphic-fetch';
import assign from 'lodash/assign';
import { updateHeaders } from 'actions/headers';
import { getSettings } from 'models/settings';
import {
parseHeaders,
getHeaders,
prepareHeadersForFetch,
areHeadersBlank
} from 'utils/headers';
export default function (url, options = {}) {

@@ -22,3 +28,5 @@ return (dispatch, getState) => {

dispatch(updateHeaders(headers));
if (!areHeadersBlank(headers, tokenFormat)) {
dispatch(updateHeaders(headers));
}

@@ -25,0 +33,0 @@ return Promise.resolve(resp);

@@ -16,2 +16,3 @@ import assign from 'lodash/assign';

let ret = null;
try {

@@ -18,0 +19,0 @@ ret = preprocessed.substr(1, preprocessed.length - 2).replace(/\{(.*?)}/g, (...m) => {

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