-
Notifications
You must be signed in to change notification settings - Fork 0
/
component---src-pages-authorize-github-jsx-104ca2f7b1c432c9c127.js
2 lines (2 loc) · 2.96 KB
/
component---src-pages-authorize-github-jsx-104ca2f7b1c432c9c127.js
1
2
(window.webpackJsonp=window.webpackJsonp||[]).push([[9],{aFtW:function(t,e,n){"use strict";function r(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return a(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=t[Symbol.iterator]()).next.bind(n)}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}n.d(e,"a",(function(){return i}));var i=function(t){for(var e,n={},a=r(t=(t=t.replace(/^\?/,"")).split("&"));!(e=a()).done;){var i=e.value.split("=");n[i[0]]=i[1]}return n}},bDEP:function(t,e,n){"use strict";n.r(e);var r=n("q1tI"),a=n.n(r),i=n("/MKj"),o=n("Wbzz"),c=n("Tgqd"),u=n("I204"),s=n("yVse"),l=n("1ajf"),b=n("sfvf"),p=n("aFtW"),f=n("qKvR"),d={name:"xi606m",styles:"text-align:center;"},h={name:"kbnfbs",styles:"height:42px;margin-bottom:25px;display:flex;align-items:center;justify-content:center;width:100%;"},j={name:"70qvj9",styles:"display:flex;align-items:center;"},m={name:"lvyu5j",styles:"margin-right:10px;"},y={name:"4g6ai3",styles:"cursor:pointer;"};e.default=Object(i.b)((function(t){return{me:t.global.me}}),(function(t){return{updateMe:function(e){return t(Object(l.b)(e))}}}))((function(t){var e=t.me,n=t.updateMe,r=a.a.useState(void 0),i=r[0],l=r[1];return a.a.useEffect((function(){if(Object(b.a)()){var t=p.a(window.location.search);t.code?window.fetch("https://gleepi.herokuapp.com/login/github",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({code:t.code})}).then((function(t){if(t.ok)return t.json();throw new Error(t.statusText)})).then((function(e){l(!0),n(e),t.path?Object(o.b)(t.path):Object(o.b)("/account")})).catch((function(t){console.error(t),l(!1)})):t.path?Object(o.b)("/authorize?path="+t.path):Object(o.b)("/authorize")}}),[n]),Object(f.a)("div",{css:d},Object(f.a)(u.a,{title:"Authorize via GitHub",description:"Login to Glee, via GitHub, to start using it."}),Object(f.a)(o.a,{to:"/",css:h},Object(f.a)(s.a,{width:"100%"})),Object(f.a)("div",{css:j},Object(f.a)(c.d,{css:m}),Object(f.a)("div",null,!0===i?Object(f.a)("span",null,"Authenticated ",e?e.name||e.login:""," with GitHub"):!1===i?Object(f.a)("span",null,"Unauthorized. ",Object(f.a)("span",{css:y,onClick:function(){return Object(b.a)()?window.location.reload():{}}},"Try again?")):Object(f.a)("span",null,"Authenticating with GitHub..."))))}))}}]);
//# sourceMappingURL=component---src-pages-authorize-github-jsx-104ca2f7b1c432c9c127.js.map