react-google-oauth2
Advanced tools
Comparing version 0.0.21 to 0.0.22
import { IAuthorizationOptions } from "./authorization"; | ||
import { isLoggedIn, logOutOAuthUser, createOAuthHeaders } from "./_apiUtils"; | ||
import { GoogleButton, IGoogleButton, GoogleAuth } from "./components"; | ||
export { GoogleButton, IGoogleButton, IAuthorizationOptions, isLoggedIn, logOutOAuthUser, createOAuthHeaders, GoogleAuth, }; | ||
import { GoogleButton, IGoogleButton, GoogleAuth, GoogleAuthConsumer } from "./components"; | ||
export { GoogleButton, IGoogleButton, IAuthorizationOptions, isLoggedIn, logOutOAuthUser, createOAuthHeaders, GoogleAuth, GoogleAuthConsumer, }; |
@@ -1,2 +0,2 @@ | ||
module.exports=function(e){var t={};function r(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(o,n,function(t){return e[t]}.bind(null,n));return o},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1)}([function(e,t){e.exports=require("react")},function(e,t,r){"use strict";r.r(t),r.d(t,"GoogleButton",(function(){return S})),r.d(t,"isLoggedIn",(function(){return c})),r.d(t,"logOutOAuthUser",(function(){return u})),r.d(t,"createOAuthHeaders",(function(){return s})),r.d(t,"GoogleAuth",(function(){return O}));var o=function(){return(o=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},n=function(e,t,r,o){return new(r||(r=Promise))((function(n,i){function a(e){try{u(o.next(e))}catch(e){i(e)}}function c(e){try{u(o.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,c)}u((o=o.apply(e,t||[])).next())}))},i=function(e,t){var r,o,n,i,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,o&&(n=2&i[0]?o.return:i[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,i[1])).done)return n;switch(o=0,n&&(i=[2&i[0],n.value]),i[0]){case 0:case 1:n=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(n=a.trys,(n=n.length>0&&n[n.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!n||i[1]>n[0]&&i[1]<n[3])){a.label=i[1];break}if(6===i[0]&&a.label<n[1]){a.label=n[1],n=i;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(i);break}n[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],o=0}finally{r=n=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}};function a(e){var t=e.email,r=void 0===t?"":t,a=e.code;(function(e,t){return n(this,void 0,void 0,(function(){return i(this,(function(r){switch(r.label){case 0:return[4,fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})];case 1:return[2,r.sent().json()]}}))}))})(e.apiUrl,{code:a,email:r,scope:e.scope}).then((function(t){"access_token"in t?e.setResponseState({accessToken:t.access_token}):e.setResponseState({error:"No access_token in response data!"})})).catch((function(t){e.setResponseState(o(o({},e.responseState),{error:t.message,accessToken:void 0}))}))}function c(){return!!window.localStorage.getItem("accessToken")}function u(){window.localStorage.removeItem("accessToken")}function s(){return{"Content-type":"application/jsons","X-Auth-Token":"Bearer "+window.localStorage.getItem("accessToken")}}function l(){var e=document.location.href;if(document.location.search){var t=e.substring(0,e.indexOf("?"));window.history.replaceState({},document.title,t)}}var p,d=r(0),f=r.n(d);!function(e){e.GOOGLE_OAUTH_ENDPOINT="https://accounts.google.com/o/oauth2/v2/auth"}(p||(p={}));var h=function(){function e(e,t){var r=this;this.redirect=function(e){if(!r.googleRedirectURL)throw new ReferenceError("Error creating redirect url to Google's authorization server");window.location.replace(r.googleRedirectURL)},this.params=e,this.scopesStr=t}return Object.defineProperty(e.prototype,"googleRedirectURL",{get:function(){return this._googleRedirectURL},set:function(e){this._googleRedirectURL=e},enumerable:!1,configurable:!0}),e.prototype.createAuthorizationRequestURL=function(){var e,t=this.params,r=t.accessType,o=void 0===r?"offline":r,n=t.includeGrantedScopes,i=void 0===n||n,a=t.responseType,c=void 0===a?"code":a,u=t.state,s=void 0===u?null:u,l=t.redirectUri,d=t.clientId;e=p.GOOGLE_OAUTH_ENDPOINT+"?scope="+this.scopesStr+"&",e=(e=(e=o?e+"access_type="+o+"&":e)+"include_granted_scopes="+i+"&")+"response_type="+c+"&",e=(e=(e=s?e+"state="+s+"&":e)+"redirect_uri="+l+"&")+"client_id="+d,this.googleRedirectURL=e},e.createScopes=function(e){var t="";return e.map((function(r,o){e.length-1===o?t+=""+r:t+=r+"%20"})),t},e}(),g=function(){return(g=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},b={},v={backgroundSize:"20px 20px",backgroundRepeat:"no-repeat",backgroundPosition:"12px 10px",textIndent:"19px",border:"1px solid #bdc3c7",padding:"9px 23px",borderRadius:"9px",backgroundColor:"#bdc3c7",fontSize:"18px"},y=f.a.createContext({isAuthenticated:!0}),m=y.Provider,O=y.Consumer,w=function(e){var t=e.placeholder,r=void 0===t?"":t,o=e.defaultStyle,n=void 0===o||o,i=e.options,a=(e.displayErrors,e.isAuthenticated),c=e._updateOAuth,u=h.createScopes(i.scopes),s=new h(i,u);s.createAuthorizationRequestURL();var p=n?function(e,t){return e?g(g({},t),{backgroundImage:"url("+e+")"}):t}(r,v):void 0;return e.error&&console.error("[React-Google-OAuth2] Error: "+e.error+"\n - To display the error to the user, set IGoogleProps displayErrors to true.\n See https://joegasewicz.github.io/react-google-oauth2.0/"),l(),f.a.createElement(f.a.Fragment,null,f.a.createElement(m,{value:{_updateOAuth:c,isAuthenticated:a}},f.a.createElement("button",{style:p,onClick:s.redirect},"Sign in with google"),e.displayErrors&&e.error&&f.a.createElement("div",null,e.error)))},S=function(e){var t,r=e.callback,o=Object(d.useState)(b),n=o[0],i=o[1],u=Object(d.useState)(!1),s=u[0],p=u[1],h=function(e){return p(!e)},v=Object(d.useContext)(y),m=new URLSearchParams(window.location.search),O=m.get("code"),S=m.get("error");if(n.accessToken&&!c())return t=n.accessToken,window.localStorage.setItem("accessToken",t),Object(d.useEffect)((function(){return v._updateOAuth(s)}),[]),console.debug("`accessToken` set in local storage."),null;if(n.error)return console.error("[React-Google-OAuth2] Error: Api call failed with "+n.error+" error."),f.a.createElement(w,g({},e,{placeholder:e.placeholder,error:n.error,_updateOAuth:h,apiUrl:e.apiUrl,isAuthenticated:s,options:e.options}));if(O&&!c()){var _={email:m.get("email")||"",scope:m.get("scope")||"",code:O,client_id:e.options.clientId,apiUrl:e.apiUrl,responseState:n,setResponseState:i};return l(),Object(d.useEffect)((function(){a(_)}),[]),console.debug("Waiting for remote api response"),r?r():f.a.createElement(f.a.Fragment,null,"Loading...")}return S?(console.error("Error: Google login attempt failed with "+S+" error."),f.a.createElement(w,g({},e,{placeholder:e.placeholder,error:n.error,_updateOAuth:h,apiUrl:e.apiUrl,isAuthenticated:s,options:e.options}))):f.a.createElement(w,g({},e,{placeholder:e.placeholder,error:n.error,_updateOAuth:h,apiUrl:e.apiUrl,isAuthenticated:s,options:e.options}))}}]); | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9yZWFjdC1nb29nbGUtb2F1dGgvd2VicGFjay9ib290c3RyYXAiLCJ3ZWJwYWNrOi8vcmVhY3QtZ29vZ2xlLW9hdXRoL2V4dGVybmFsIFwicmVhY3RcIiIsIndlYnBhY2s6Ly9yZWFjdC1nb29nbGUtb2F1dGgvLi9zcmMvX2FwaVV0aWxzLnRzIiwid2VicGFjazovL3JlYWN0LWdvb2dsZS1vYXV0aC8uL3NyYy9hdXRob3JpemF0aW9uLnRzIiwid2VicGFjazovL3JlYWN0LWdvb2dsZS1vYXV0aC8uL3NyYy9jb21wb25lbnRzLnRzeCJdLCJuYW1lcyI6WyJpbnN0YWxsZWRNb2R1bGVzIiwiX193ZWJwYWNrX3JlcXVpcmVfXyIsIm1vZHVsZUlkIiwiZXhwb3J0cyIsIm1vZHVsZSIsImkiLCJsIiwibW9kdWxlcyIsImNhbGwiLCJtIiwiYyIsImQiLCJuYW1lIiwiZ2V0dGVyIiwibyIsIk9iamVjdCIsImRlZmluZVByb3BlcnR5IiwiZW51bWVyYWJsZSIsImdldCIsInIiLCJTeW1ib2wiLCJ0b1N0cmluZ1RhZyIsInZhbHVlIiwidCIsIm1vZGUiLCJfX2VzTW9kdWxlIiwibnMiLCJjcmVhdGUiLCJrZXkiLCJiaW5kIiwibiIsIm9iamVjdCIsInByb3BlcnR5IiwicHJvdG90eXBlIiwiaGFzT3duUHJvcGVydHkiLCJwIiwicyIsInJlcXVpcmUiLCJzZXJ2ZXJSZXNwb25zZSIsInByb3BzIiwi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aVVybChhcGlVcmwsIHBheWxvYWQpXG4gICAgICAgIC50aGVuKChkYXRhOiBJQXBpUmVzcG9uc2VEYXRhKSA9PiB7XG4gICAgICAgICAgICAvLyB1cGRhdGUgcmVzcG9uc2VTdGF0ZSBhY2Nlc3NUb2tlblxuICAgICAgICAgICAgaWYoIShcImFjY2Vzc190b2tlblwiIGluIGRhdGEpKSB7XG4gICAgICAgICAgICAgICAgcHJvcHMuc2V0UmVzcG9uc2VTdGF0ZSh7XG4gICAgICAgICAgICAgICAgICAgIGVycm9yOiBcIk5vIGFjY2Vzc190b2tlbiBpbiByZXNwb25zZSBkYXRhIVwiLFxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBwcm9wcy5zZXRSZXNwb25zZVN0YXRlKHtcbiAgICAgICAgICAgICAgICAgICAgYWNjZXNzVG9rZW46IGRhdGEuYWNjZXNzX3Rva2VuLFxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgIH0pXG4gICAgICAgIC5jYXRjaChlcnIgPT4ge1xuICAgICAgICAgICAgcHJvcHMuc2V0UmVzcG9uc2VTdGF0ZSh7XG4gICAgICAgICAgICAgICAgLi4ucHJvcHMucmVzcG9uc2VTdGF0ZSxcbiAgICAgICAgICAgICAgICBlcnJvcjogZXJyLm1lc3NhZ2UsXG4gICAgICAgICAgICAgICAgYWNjZXNzVG9rZW46IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIH0pXG4gICAgICAgIH0pO1xufVxuLyoqIEBpbnRlcm5hbCAqL1xuZXhwb3J0IGZ1bmN0aW9uIHN0b3JlQWNjZXNzVG9rZW4odG9rZW46IHN0cmluZyk6IHZvaWQge1xuICAgICB3aW5kb3cubG9jYWxTdG9yYWdlLnNldEl0ZW0oXCJhY2Nlc3NUb2tlblwiLCB0b2tlbik7XG59XG5cbi8qKlxuICogQGV4YW1wbGVcbiAqIGBgYFxuICogIGlmKG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R1cm4gPElubmVyQnV0dG9uXG4gICAgICAgICAgICAgICAgey4uLnByb3BzfVxuICAgICAgICAgICAgICAgIHBsYWNlaG9sZGVyPXtwcm9wcy5wbGFjZWhvbGRlcn1cbiAgICAgICAgICAgICAgICBlcnJvcj17cmVzcG9uc2VTdGF0ZS5lcnJvcn1cbiAgICAgICAgICAgICAgICBfdXBkYXRlT0F1dGg9e191cGRhdGVPQXV0aH1cbiAgICAgICAgICAgICAgICBhcGlVcmw9e3Byb3BzLmFwaVVybH1cbiAgICAgICAgICAgICAgICBpc0F1dGhlbnRpY2F0ZWQ9e2lzQXV0aGVudGljYXRlZH1cbiAgICAgICAgICAgICAgICBvcHRpb25zPXtwcm9wcy5vcHRpb25zfVxuICAgICAgICAvPjtcbiAgICB9IGVsc2UgaWYgKHF1ZXJ5UGFyYW1zQ29kZSAmJiAhaXNMb2dnZWRJbigpKSB7XG4gICAgICAgIC8vIEdldCByZXN0IG9mIHBhcmFtc1xuICAgICAgICBjb25zdCBxdWVyeVBhcmFtc0VtYWlsID0gY3VycmVudFVybC5nZXQoXCJlbWFpbFwiKSB8fCBcIlwiO1xuICAgICAgICBjb25zdCBxdWVyeVBhcmFtc1Njb3BlID0gY3VycmVudFVybC5nZXQoXCJzY29wZVwiKSB8fCBcIlwiO1xuICAgICAgICBjb25zdCBzZXJ2ZXJSZXNwb25zZVByb3BzOiBJU2VydmVyUmVzcG9uc2UgPSB7XG4gICAgICAgICAgICBlbWFpbDogcXVlcnlQYXJhbXNFbWFpbCxcbiAgICAgICAgICAgIHNjb3BlOiBxdWVyeVBhcmFtc1Njb3BlLFxuICAgICAgICAgICAgY29kZTogcXVlcnlQYXJhbXNDb2RlLFxuICAgICAgICAgICAgY2xpZW50X2lkOiBwcm9wcy5vcHRpb25zLmNsaWVudElkLFxuICAgICAgICAgICAgYXBpVXJsOiBwcm9wcy5hcGlVcmwsXG4gICAgICAgICAgICByZXNwb25zZVN0YXRlLFxuICAgICAgICAgICAgc2V0UmVzcG9uc2VTdGF0ZSxcbiAgICAgICAgfTtcbiAgICAgICAgcmVtb3ZlT0F1dGhRdWVyeVBhcmFtcygpO1xuICAgICAgICB1c2VFZmZlY3QoKCkgPT4ge1xuICAgICAgICAgICBzZXJ2ZXJSZXNwb25zZShzZXJ2ZXJSZXNwb25zZVByb3BzKTtcbiAgICAgICAgfSwgW10pO1xuICAgICAgICBjb25zb2xlLmRlYnVnKFwiV2FpdGluZyBmb3IgcmVtb3RlIGFwaSByZXNwb25zZVwiKTtcbiAgICAgICAgcmV0dXJuIGNhbGxiYWNrID8gY2FsbGJhY2soKSA6IDw+TG9hZGluZy4uLjwvPjtcbiAgICB9IGVsc2UgaWYocXVlcnlQYXJhbXNFcnJvcikge1xuICAgICAgICBjb25zb2xlLmVycm9yKGBFcnJvcjogR29vZ2xlIGxvZ2luIGF0dGVtcHQgZmFpbGVkIHdpdGggJHtxdWVyeVBhcmFtc0Vycm9yfSBlcnJvci5gKVxuICAgICAgICByZXR1cm4gPElubmVyQnV0dG9uXG4gICAgICAgICAgICAgICAgey4uLnByb3BzfVxuICAgICAgICAgICAgICAgIHBsYWNlaG9sZGVyPXtwcm9wcy5wbGFjZWhvbGRlcn1cbiAgICAgICAgICAgICAgICBlcnJvcj17cmVzcG9uc2VTdGF0ZS5lcnJvcn1cbiAgICAgICAgICAgICAgICBfdXBkYXRlT0F1dGg9e191cGRhdGVPQXV0aH1cbiAgICAgICAgICAgICAgICBhcGlVcmw9e3Byb3BzLmFwaVVybH1cbiAgICAgICAgICAgICAgICBpc0F1dGhlbnRpY2F0ZWQ9e2lzQXV0aGVudGljYXRlZH1cbiAgICAgICAgICAgICAgICBvcHRpb25zPXtwcm9wcy5vcHRpb25zfVxuICAgICAgICAvPjs7XG4gICAgfVxuICAgIC8vIERpc3BsYXkgYnV0dG9uIHdpdGggbm8gZXJyb3JzXG4gICAgcmV0dXJuIDxJbm5lckJ1dHRvblxuICAgICAgICAgICAgICAgIHsuLi5wcm9wc31cbiAgICAgICAgICAgICAgICBwbGFjZWhvbGRlcj17cHJvcHMucGxhY2Vob2xkZXJ9XG4gICAgICAgICAgICAgICAgZXJyb3I9e3Jlc3BvbnNlU3RhdGUuZXJyb3J9XG4gICAgICAgICAgICAgICAgX3VwZGF0ZU9BdXRoPXtfdXBkYXRlT0F1dGh9XG4gICAgICAgICAgICAgICAgYXBpVXJsPXtwcm9wcy5hcGlVcmx9XG4gICAgICAgICAgICAgICAgaXNBdXRoZW50aWNhdGVkPXtpc0F1dGhlbnRpY2F0ZWR9XG4gICAgICAgICAgICAgICAgb3B0aW9ucz17cHJvcHMub3B0aW9uc31cbiAgICAgICAgLz47O1xufVxuIl0sInNvdXJjZVJvb3QiOiIifQ== | ||
module.exports=function(e){var t={};function r(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(o,n,function(t){return e[t]}.bind(null,n));return o},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1)}([function(e,t){e.exports=require("react")},function(e,t,r){"use strict";r.r(t),r.d(t,"GoogleButton",(function(){return O})),r.d(t,"isLoggedIn",(function(){return a})),r.d(t,"logOutOAuthUser",(function(){return i})),r.d(t,"createOAuthHeaders",(function(){return s})),r.d(t,"GoogleAuth",(function(){return w})),r.d(t,"GoogleAuthConsumer",(function(){return m}));var o=function(e,t,r,o){return new(r||(r=Promise))((function(n,c){function a(e){try{s(o.next(e))}catch(e){c(e)}}function i(e){try{s(o.throw(e))}catch(e){c(e)}}function s(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,i)}s((o=o.apply(e,t||[])).next())}))},n=function(e,t){var r,o,n,c,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return c={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function i(c){return function(i){return function(c){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,o&&(n=2&c[0]?o.return:c[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,c[1])).done)return n;switch(o=0,n&&(c=[2&c[0],n.value]),c[0]){case 0:case 1:n=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,o=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(n=a.trys,(n=n.length>0&&n[n.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!n||c[1]>n[0]&&c[1]<n[3])){a.label=c[1];break}if(6===c[0]&&a.label<n[1]){a.label=n[1],n=c;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(c);break}n[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],o=0}finally{r=n=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,i])}}};function c(e){var t=e.email,r=void 0===t?"":t,c=e.code;(function(e,t){return o(this,void 0,void 0,(function(){return n(this,(function(r){switch(r.label){case 0:return[4,fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})];case 1:return[2,r.sent().json()]}}))}))})(e.apiUrl,{code:c,email:r,scope:e.scope}).then((function(t){"access_token"in t?e.setResponseState({accessToken:t.access_token}):e.setResponseState({error:"No access_token in response data!"})})).catch((function(t){e.setResponseState({error:t.message})}))}function a(){return!!window.localStorage.getItem("accessToken")}function i(){window.localStorage.removeItem("accessToken")}function s(){return{"Content-type":"application/jsons","X-Auth-Token":"Bearer "+window.localStorage.getItem("accessToken")}}function u(){var e=document.location.href;if(document.location.search){var t=e.substring(0,e.indexOf("?"));window.history.replaceState({},document.title,t)}}var l,p=r(0),d=r.n(p);!function(e){e.GOOGLE_OAUTH_ENDPOINT="https://accounts.google.com/o/oauth2/v2/auth"}(l||(l={}));var f=function(){function e(e,t){var r=this;this.redirect=function(e){if(!r.googleRedirectURL)throw new ReferenceError("Error creating redirect url to Google's authorization server");window.location.replace(r.googleRedirectURL)},this.params=e,this.scopesStr=t}return Object.defineProperty(e.prototype,"googleRedirectURL",{get:function(){return this._googleRedirectURL},set:function(e){this._googleRedirectURL=e},enumerable:!1,configurable:!0}),e.prototype.createAuthorizationRequestURL=function(){var e,t=this.params,r=t.accessType,o=void 0===r?"offline":r,n=t.includeGrantedScopes,c=void 0===n||n,a=t.responseType,i=void 0===a?"code":a,s=t.state,u=void 0===s?null:s,p=t.redirectUri,d=t.clientId;e=l.GOOGLE_OAUTH_ENDPOINT+"?scope="+this.scopesStr+"&",e=(e=(e=o?e+"access_type="+o+"&":e)+"include_granted_scopes="+c+"&")+"response_type="+i+"&",e=(e=(e=u?e+"state="+u+"&":e)+"redirect_uri="+p+"&")+"client_id="+d,this.googleRedirectURL=e},e.createScopes=function(e){var t="";return e.map((function(r,o){e.length-1===o?t+=""+r:t+=r+"%20"})),t},e}(),g=function(){return(g=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},h={},b={backgroundSize:"20px 20px",backgroundRepeat:"no-repeat",backgroundPosition:"12px 10px",textIndent:"19px",border:"1px solid #bdc3c7",padding:"9px 23px",borderRadius:"9px",backgroundColor:"#bdc3c7",fontSize:"18px"},v=d.a.createContext({}),y=v.Provider,m=v.Consumer,S=function(e){var t=e.placeholder,r=void 0===t?"":t,o=e.defaultStyle,n=void 0===o||o,c=e.options,a=e.displayErrors,i=void 0!==a&&a,s=f.createScopes(c.scopes),l=new f(c,s);l.createAuthorizationRequestURL();var p=n?function(e,t){return e?g(g({},t),{backgroundImage:"url("+e+")"}):t}(r,b):void 0;return e.error&&console.error("[React-Google-OAuth2] Error: "+e.error+"\n - To display the error to the user, set IGoogleProps displayErrors to true.\n See https://joegasewicz.github.io/react-google-oauth2.0/"),u(),d.a.createElement(d.a.Fragment,null,d.a.createElement("button",{style:p,onClick:l.redirect},e.children),i&&e.error&&d.a.createElement("div",null,e.error))};function O(e){var t,r=e.callback,o=Object(p.useContext)(v),n=new URLSearchParams(window.location.search),i=n.get("code"),s=n.get("error"),l=d.a.createElement(S,g({},e,{placeholder:e.placeholder,error:o.responseState.error,options:e.options}));if(o.responseState.accessToken&&!a())return t=o.responseState.accessToken,window.localStorage.setItem("accessToken",t),console.debug("`accessToken` set in local storage."),"function"==typeof o.setOAuthState&&Object(p.useEffect)((function(){o.setOAuthState(!0)})),null;if(o.responseState.error)return console.error("[React-Google-OAuth2] Error: Api call failed with "+o.responseState.error+" error."),l;if(i&&!a()){var f={email:n.get("email")||"",scope:n.get("scope")||"",code:i,client_id:e.options.clientId,apiUrl:e.apiUrl,responseState:o.responseState,setResponseState:o.setResponseState};return u(),Object(p.useEffect)((function(){c(f)}),[]),console.debug("Waiting for remote api response"),r?r():d.a.createElement(d.a.Fragment,null,"Loading...")}return s?(console.error("Error: Google login attempt failed with "+s+" error."),l):l}var w=function(e){var t=Object(p.useState)(h),r=t[0],o=t[1],n=Object(p.useState)(a()),c={isAuthenticated:n[0],setOAuthState:n[1],responseState:r,setResponseState:o};return d.a.createElement(y,{value:c},e.children)}}]); | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s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Jzb3VyY2VSb290IjoiIn0= |
{ | ||
"name": "react-google-oauth2", | ||
"version": "0.0.21", | ||
"version": "0.0.22", | ||
"main": "lib/index.js", | ||
@@ -5,0 +5,0 @@ "types": "lib/index.d.ts", |
@@ -59,3 +59,3 @@ [![GitHub license](https://img.shields.io/github/license/joegasewicz/react-google-oauth2.0)](https://github.com/joegasewicz/react-google-oauth2.0/blob/main/LICENSE) | ||
``` | ||
### GoogleAuth Provider | ||
### GoogleAuth Provider & GoogleAuthConsumer | ||
Get notified when a user has logged in successfully by wrapping the | ||
@@ -65,13 +65,20 @@ `GoogleButton` component within the `GoogleAuth` provider. For example: | ||
import { | ||
GoogleAuth | ||
GoogleAuth, | ||
GoogleButton, | ||
GoogleAuthConsumer, | ||
} from "react-google-oauth2"; | ||
<GoogleAuth> | ||
{({isAuthenticated}) => { | ||
// isAuthenticated will get set to true when a user has successfully logged in. | ||
console.log("value: ", isAuthenticated); // value: true or false | ||
return <GoogleButton | ||
// options... | ||
/> | ||
}} | ||
<GoogleButton | ||
placeholder="demo/search.png" // Optional | ||
options={options} | ||
apiUrl="http://localhost:5000/google_login" | ||
defaultStyle={true} // Optional | ||
displayErrors={true}>Sign in with google</GoogleButton> | ||
<GoogleAuthConsumer> | ||
{({isAuthenticated}: any) => { | ||
console.log("isAuthenticated", isAuthenticated); | ||
return null; | ||
}} | ||
</GoogleAuthConsumer> | ||
</GoogleAuth> | ||
@@ -78,0 +85,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
114
47889
32