-
Notifications
You must be signed in to change notification settings - Fork 0
/
component---src-pages-authorize-index-jsx-a68941675a8ae8dba769.js.map
1 lines (1 loc) · 3.3 KB
/
component---src-pages-authorize-index-jsx-a68941675a8ae8dba769.js.map
1
{"version":3,"sources":["webpack:///./src/utils/querystring.js","webpack:///./src/pages/authorize/index.jsx"],"names":["parse","search","qs","replace","split","data","SignInButton","children","props","css","authorizeGitHubIdentity","url","isBrowser","querystring","window","location","path","encodeURI","origin","href","React","useEffect","title","description","to","width","onClick"],"mappings":"g8BAAO,IAAMA,EAAQ,SAACC,GAKlB,IADA,IACA,EADMC,EAAK,GACX,IAHAD,GADAA,EAASA,EAAOE,QAAQ,MAAO,KACfC,MAAM,QAGtB,aAA0B,CAAC,IACnBC,EADkB,QACLD,MAAM,KACvBF,EAAGG,EAAK,IAAMA,EAAK,GAGvB,OAAOH,I,0OCDLI,EAAe,SAAC,GAAD,IAAGC,EAAH,EAAGA,SAAaC,EAAhB,mCACjB,kCAAQC,IAAG,GAGHD,GACFD,IAIJG,EAA0B,WAC5B,IAAIC,EAAM,2FAEV,GAAKC,cAAL,CAEA,IAAMV,EAAKW,IAAkBC,OAAOC,SAASd,QACzCC,EAAGc,OACHL,GAAO,iBAAmBM,UAAUH,OAAOC,SAASG,OAAS,0BAA4BhB,EAAGc,OAEhGF,OAAOC,SAASI,KAAOR,I,yNAGZ,qBAIX,OAHAS,IAAMC,WAAU,cACb,IAGC,mBAAKZ,IAAG,GAGJ,YAAC,IAAD,CACIa,MAAM,YACNC,YAAY,qCAEhB,YAAC,IAAD,CACIC,GAAG,IACHf,IAAG,GASH,YAAC,IAAD,CAAMgB,MAAM,UAEhB,uBACI,YAACnB,EAAD,CAAcoB,QAAUhB,GACpB,YAAC,IAAD,CAAUD,IAAG,IACb","file":"component---src-pages-authorize-index-jsx-a68941675a8ae8dba769.js","sourcesContent":["export const parse = (search) => {\n search = search.replace(/^\\?/, \"\");\n search = search.split(\"&\");\n\n const qs = {};\n for (let field of search) {\n let data = field.split(\"=\");\n qs[data[0]] = data[1];\n }\n\n return qs;\n};\n","import React from \"react\";\nimport { Link } from \"gatsby\";\nimport { FiGithub } from \"react-icons/fi\";\n\nimport Helmet from \"../../components/Helmet\";\nimport Logo from \"../../components/Logo\";\nimport isBrowser from \"../../utils/isBrowser\";\nimport * as querystring from \"../../utils/querystring\";\n\nconst SignInButton = ({ children, ...props }) => (\n <button css={{\n display: \"flex\",\n alignItems: \"center\",\n }} { ...props }>\n { children }\n </button>\n);\n\nconst authorizeGitHubIdentity = () => {\n let url = \"https://github.com/login/oauth/authorize?scope=user:email&client_id=\" + process.env.GITHUB_CLIENT_ID;\n\n if (!isBrowser()) return;\n\n const qs = querystring.parse(window.location.search);\n if (qs.path) {\n url += \"&redirect_uri=\" + encodeURI(window.location.origin + \"/authorize/github?path=\" + qs.path);\n }\n window.location.href = url;\n};\n\nexport default () => {\n React.useEffect(() => {\n }, []);\n\n return (\n <div css={{\n textAlign: \"center\",\n }}>\n <Helmet\n title=\"Authorize\"\n description=\"Login to Glee to start using it.\"\n />\n <Link\n to=\"/\"\n css={{\n height: 42,\n marginBottom: 25,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n width: \"100%\",\n }}\n >\n <Logo width=\"100%\" />\n </Link>\n <div>\n <SignInButton onClick={ authorizeGitHubIdentity }>\n <FiGithub css={{ marginRight: 10 }} />\n <div>Login with GitHub</div>\n </SignInButton>\n </div>\n </div>\n );\n}\n"],"sourceRoot":""}