PageSourceSearch

https://official-web-asset.tappytoon.com/_next/static/chunks/pages/oauth/google/callback-d165c62bb325ebf9.js

js tappytoon.com collected 2026-10-01 11:42:24 UTC 3,281 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4162],{71575:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/oauth/google/callback",function(){return a(23295)}])},23295:function(e,t,a){"use strict";a.r(t);var r=a(43653),n=a.n(r),o=a(38240),i=a(4112),c=a(17765),l=a(5956),u=a(12676),s=a(92029),d=a(44279);let g=o.yI.GOOGLE,p={redirect_uri:"/"},exchangeCodeForAccessToken=async e=>{let{query:t}=e,{code:a}=t,r=(0,c.d)("/api/third-parties/google/token"),{data:o}=await n().get(r,{params:{code:a}});return o},Page=()=>null;Page.getInitialProps=async e=>{let{req:t,res:a,isServer:r,store:n}=e;if(!r)return window.location.replace("/");let c=s.Z.getState(e,p),h=(0,d.D)(c.redirect_uri,"/"),{access_token:v}=await exchangeCodeForAccessToken(e),{email:w}=await s.Z.getUserInfo(v),_=(0,i.XXE)(t.i18n),f=(0,i.JvL)(w),S=null!=f?f:t.i18n.getResource(_,"page-dependent-ui","continuous-login.google-login"),y=o.oauth2Spec.authorizeBySocial({provider:g,accessToken:v,allowDuplicateEmail:"true"===c.allowDuplicateEmail});try{let e=await n.axios.request(y);(0,l.wT)(t,a,{...e.data,continuousLoginUsername:S,grantType:o.Nf.SOCIAL,throughRegistration:(0,i.M4j)({response:e})}),a.redirect(h)}catch(t){let e=(0,u.Q)({error:t,provider:g,state:c,safeRedirectUri:h});if(e)return a.redirect(e);throw t}},t.default=Page},12676:function(e,t,a){"use strict";a.d(t,{Q:function(){return buildDuplicateAccountRedirectPath}});var r=a(38240);let getReturnPath=e=>(null==e?void 0:e.duplicateReturnPath)==="register"?"/register":"/login",buildDuplicateAccountRedirectPath=e=>{var t,a,n,o,i,c,l;let{error:u,provider:s,state:d,safeRedirectUri:g}=e,p=null===(t=u.response)||void 0===t?void 0:t.status,h=null===(a=u.response)||void 0===a?void 0:a.data;if(!(0,r.hI)(p,null==h?void 0:h.code))return null;let v=new URLSearchParams({duplicate:"1",attempted:s,registered:null!==(c=null==h?void 0:null===(o=h.metadata)||void 0===o?void 0:null===(n=o.existingProviders)||void 0===n?void 0:n[0])&&void 0!==c?c:"",email:null!==(l=null==h?void 0:null===(i=h.metadata)||void 0===i?void 0:i.email)&&void 0!==l?l:"",redirect_uri:g});return"".concat(getReturnPath(d),"?").concat(v.toString())}},92029:function(e,t,a){"use strict";var r=a(43653),n=a.n(r),o=a(72124),i=a(29488);let c="https://accounts.google.com/o/oauth2/".concat("v2","/auth"),l="https://www.googleapis.com/oauth2/".concat("v2","/userinfo"),getRawState=e=>{let{query:t}=e,{state:a}=t;return a},parseState=(e,t)=>{try{return JSON.parse(e)||t}catch(e){return t}},exchangeCodeForAccessToken=async e=>{let{clientId:t,clientSecret:a,code:r,redirectUri:o}=e,{data:i}=await n().post("https://oauth2.googleapis.com/token",{client_id:t,client_secret:a,redirect_uri:o,grant_type:"authorization_code",code:r});return i},getUserInfo=async e=>{let{data:t}=await n().get(l,{headers:{Authorization:"Bearer ".concat(e)}});return t};t.Z={exchangeCodeForAccessToken,getState:(e,t)=>{let a=getRawState(e);return parseState(a,t)},getRawState,getUserInfo,login:e=>{let{clientId:t,handler:a,redirectUri:r,scopes:n,state:l={}}=e,u=o.stringify({client_id:t,redirect_uri:r,response_type:"code",scope:i.Z(" ",n),state:"".concat(JSON.stringify(l))}),s="".concat(c,"?").concat(u);a&&a(s)}}}},function(e){e.O(0,[9774,2888,179],function(){return e(e.s=71575)}),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.