PageSourceSearch

https://assets.cdn.ifixit.com/AssetsV2/scripts/shared-auth.aa1ebf34956cb411664c.js

js ifixit.com collected 2026-10-01 08:34:06 UTC 5,981 bytes, 2 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"a99e4c3265af7c5eece8156095b05d1ffcc8ba85"},e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[(new e.Error).stack]=function(e){for(var n=1;n<arguments.length;n++){var o=arguments[n];if(null!=o)for(var t in o)o.hasOwnProperty(t)&&(e[t]=o[t])}return e}({},e._sentryModuleMetadata[(new e.Error).stack],{"_sentryBundlerPluginAppKey:ifixitFirstParty":!0});var n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="267dae4f-20a3-46bb-b870-2f9a9b4242b6",e._sentryDebugIdIdentifier="sentry-dbid-267dae4f-20a3-46bb-b870-2f9a9b4242b6")}catch(e){}}(),(globalThis.webpackChunkcarpenter_frontend=globalThis.webpackChunkcarpenter_frontend||[]).push([[4655],{18891(e,n,o){o.d(n,{Auth:()=>l});var t=o(21328),s=o(14659),i=o(86318),r=o(41791),a=o(43308),d=o(60128);const l=window.Auth=new Class({});Object.append(l,{protocol:window.location.protocol.slice(0,-1),cookies:[],defaultOptions:{from:"navLogin",onAuthorize:()=>{},close:!0,reload:!1,locked:!1,noOverlay:!1,stayInWindow:!1,register:!0},login:function(e){if(e=Object.merge({},this.defaultOptions,e),this.trySSOLogin(e))return;const n=$("inviteData");window.ReactLoginPortal.open({message:e.message,email:n?n.get("data-email"):void 0,onSuccess:()=>{e.onAuthorize(),e.reload&&window.location.reload()},onCancel:e.onCancel})},logout:()=>{window.location=window.shared_constants.GuideURI("TAG_LOGOUT")},trySSOLogin:function(e){let n=App["single-sign-on-url"],o=e&&e.ignoreSSO,t={maxAgeInSeconds:840};if(App["multi-login"]||!n||o)return!1;if(n=e.register?n.register:n.login,e.reload||e.stayInWindow)r.s.set("sso-origin",window.location.href,t),window.location=n;else{r.s.set("sso-origin",window.shared_constants.GuideURI("TAG_SSO_CLOSE_WINDOW"),t);const e=window.open(n,"sso_window");(0,s.U)(e,(e=>{e&&new Request.JSON({url:window.shared_constants.GuideURI("TAG_USER_DETAILS"),onSuccess:this.responseHandler}).get()}))}return!0},clearCookies:function(){this.cookies.forEach((e=>Cookie.dispose(e))),this.cookies=[]},sendFacebookLogin:function(e){this.onComplete=e;let n=window.location.toString().replace(/^[^/]+\/\/([^/]+).*$/,"$1");n=n.replace(/^meta\./,"www."),new Element("script",{src:this.protocol+"://"+n+window.shared_constants.GuideURI("TAG_LOGIN")+"/facebookLogin?"+Number.random(0,999999999)}).inject(document.body),this.clearCookies.delay(15e3,this)},sendLogin:function(e){this.onComplete=e.handler;let n=e.login,o=e.password,t=e.googleOAuthData,s=null;t&&(s=t.credential);const i={login:n,password:o,googleOAuthToken:s,captchaResult:e.captchaResult};return new Request.AjaxIO("login").send(i).then((e=>(e.login=n,this.responseHandler(e),e)))},sendRegister:function(e,n){this.onComplete=n,e.captchaResult||(e.captchaResult="1234");let o="users/join";e.inviteCode&&(o="users/join/withInviteCode"),new Request.API_2_0(o,{method:"POST",onSuccess:function(e){e.loggedIn=!0,e.newUser=!0,e.from="register",this.responseHandler(e)}.bind(this),onFailure:function(e){(e=JSON.parse(e.response)).loggedIn=!1,this.responseHandler(e)}.bind(this)}).send(e)},validateLogin:(e,n)=>new Request.API_2_0("user/login/validateLogin",{method:"POST",onSuccess:e=>{n({hasAccount:e.has_account,ssoAssociation:e.sso_association})}}).send({login:e}),sendGetLoginCode:function(e,n){return this.onComplete=n,new Request.API_2_0("user/login/getLoginCode",{method:"POST",onSuccess:function(){this.responseHandler({loggedIn:!1,emailSent:!0,from:"getLoginCode"})}.bind(this),onFailure:function(e){(e=JSON.parse(e.response)).loggedIn=!1,e.emailSent=!1,this.responseHandler(e)}.bind(this)}).send({login:e.login,captchaResult:e.captchaResult})},sendGetRegisterCode:function(e,n){return this.onComplete=n,new Request.API_2_0("user/login/getRegisterCode",{method:"POST",onSuccess:function(){this.responseHandler({loggedIn:!1,emailSent:!0,from:"getRegisterCode"})}.bind(this),onFailure:function(e){(e=JSON.parse(e.response)).loggedIn=!1,e.emailSent=!1,this.responseHandler(e)}.bind(this)}).send({login:e.login,captchaResult:e.captchaResult})},sendLoginWithCode:function(e,n){return this.onComplete=n,new Request.API_2_0("user/login/loginWithCode",{method:"POST",onSuccess:function(e){this.responseHandler({loggedIn:!0,newUser:!1,from:"loginWithCode",username:e.username})}.bind(this),onFailure:function(e){(e=JSON.parse(e.response)).loggedIn=!1,this.responseHandler(e)}.bind(this)}).send({login:e.login,code:e.code})},registerWithCode:function(e,n){return this.onComplete=n,e.captchaResult||(e.captchaResult="1234"),new Request.API_2_0("user/login/registerWithCode",{method:"POST",onSuccess:function(e){this.responseHandler({loggedIn:!0,newUser:!0,from:"registerWithCode",username:e.username})}.bind(this),onFailure:function(e){(e=JSON.parse(e.response)).loggedIn=!1,this.responseHandler(e)}.bind(this)}).send({login:e.login,username:e.username,code:e.code,inviteCode:e.inviteCode,wantsDigestEmails:e.wantsDigestEmails,wantsNewsEmails:e.wantsNewsEmails,captchaResult:e.captchaResult})},required:function(e){return this.isLoggedIn()?(e.onAuthorize&&e.onAuthorize(),!0):(e.reload&&(e.onAuthorize=()=>{}),window.ReactLoginPortal.open({message:e.message,onSuccess:()=>{e.onAuthorize(),e.reload&&window.location.reload()},onCancel:e.onCancel,register:e.register}),!1)},responseHandler:function(e){e.loggedIn?l.loggedIn(e):l.loggedOut(e),this.onComplete&&this.onComplete(e)},loggedIn:e=>{i.Y.showLoggedIn(e),App.isLoggedIn=!0;const n=(0,d.o)(e);n&&(0,a.jv)(n)},loggedOut:e=>{i.Y.showLoggedOut(),App.isLoggedIn=!1;const n=window.location.href;["edit-profile","view-profile"].forEach((e=>{n.includes(e)&&(window.location=window.shared_constants.GuideURI("TAG_SITE_HOMEPAGE"))})),e&&e.reload&&window.location.reload()},isLoggedIn:()=>App.isLoggedIn}),Object.append(l,t.b)}}]);
2//# sourceMappingURL=shared-auth.aa1ebf34956cb411664c.js.map

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.