PageSourceSearch

https://mintminer.com/assets/LinuxDoCallbackView-D35l-5Mx.js

js mintminer.com collected 2026-10-06 08:09:50 UTC 14,563 bytes, 2 lines download raw bytes

1import{d as Ue,r,c as ie,w as Q,o as Oe,X as Ie,Z as Ke,D as ze,K as ye,B as o,k as we,G as l,u as s,z as _,E as q,Q as L,$ as xe,F as O,W as X,Y,_ as He,C as v}from"./vendor-vue-Dzwqm9Y9.js";import"./AppHeader.vue_vue_type_style_index_0_scoped_80f3916c_lang-CWJeTQGo.js";import{u as We,a as $e,s as Ae,v as Ce,S as je,R as Ge,f as re,T as Fe,U as Qe,D as Xe}from"./index-BB-1BiLf.js";import"./vendor-misc-B-nM3tYW.js";import"./useClipboard-00CrFCqB.js";/* empty css                                                                       */import{A as Ye}from"./AuthLayout-DBu6UiEG.js";import{P as Ze}from"./PendingOAuthCreateAccountForm-CeNqGNMn.js";import{c as Z,l as Te,o as Se}from"./oauthAffiliate-CrlUwkd1.js";import{u as Je}from"./vendor-i18n-BuoWFzps.js";import"./CaptchaChallenge.vue_vue_type_script_setup_true_lang-CagJo7ro.js";const et={class:"space-y-6"},tt={class:"text-center"},at={class:"text-2xl font-bold text-gray-900 dark:text-white"},nt={class:"mt-2 text-sm text-gray-500 dark:text-dark-400"},ot={key:0,class:"space-y-4"},st={key:0,class:"rounded-xl border border-gray-200 bg-gray-50 p-4 dark:border-dark-600 dark:bg-dark-800/60"},it={class:"space-y-3"},rt={class:"space-y-1"},lt={class:"text-sm font-medium text-gray-900 dark:text-white"},ut={class:"text-xs text-gray-500 dark:text-dark-400"},ct={key:0,class:"flex items-start gap-3 rounded-lg border border-gray-200 bg-white p-3 text-sm dark:border-dark-600 dark:bg-dark-900/50"},dt={class:"space-y-1"},vt={class:"block font-medium text-gray-900 dark:text-white"},ht={class:"block text-gray-500 dark:text-dark-400"},_t={key:1,class:"flex items-start gap-3 rounded-lg border border-gray-200 bg-white p-3 text-sm dark:border-dark-600 dark:bg-dark-900/50"},gt=["src","alt"],pt={class:"space-y-1"},ft={class:"block font-medium text-gray-900 dark:text-white"},mt={class:"block break-all text-gray-500 dark:text-dark-400"},bt={class:"text-sm text-gray-700 dark:text-gray-300"},kt=["placeholder","disabled"],yt=["disabled"],wt={class:"text-sm text-gray-700 dark:text-gray-300"},xt=["disabled"],At={key:3,class:"rounded-xl border border-gray-200 bg-gray-50 p-4 dark:border-dark-600 dark:bg-dark-800/60"},Ct={class:"space-y-4"},Ft={class:"space-y-1"},Tt={class:"text-sm font-medium text-gray-900 dark:text-white"},St={class:"text-xs text-gray-500 dark:text-dark-400"},Pt={class:"grid gap-3 sm:grid-cols-2"},Dt=["disabled"],qt=["disabled"],Lt={class:"text-sm text-gray-700 dark:text-gray-300"},Rt={class:"text-sm text-gray-700 dark:text-gray-300"},Et={class:"space-y-3"},Bt=["placeholder","disabled"],Nt=["placeholder","disabled"],Vt=["disabled"],Mt=["disabled"],Ut={class:"text-sm text-gray-700 dark:text-gray-300"},Ot={class:"space-y-3"},It=["disabled"],Kt=["disabled"],R="LinuxDo",zt=Ue({__name:"LinuxDoCallbackView",setup(Ht){const le=Ie(),I=Ke(),{t:n}
1=Je(),E=We(),b=$e(),h=r(!0),K=r(""),k=r(!1),F=r(""),i=r(!1),J=r(""),B=r("/dashboard"),ee=r(!1),N=r(""),S=r(""),z=r(!0),H=r(!0),y=r(!1),g=r("none"),w=r(""),p=r(""),T=r(""),te=r(""),f=r(""),P=r(!1),Pe=n("profile.authBindings.bindSuccess"),W=r(!1),$=r(""),D=r(""),V=r(""),ae=r(""),ue=ie(()=>g.value==="create_account"),ce=ie(()=>g.value==="choose_account_action"),de=ie(()=>g.value==="bind_login");Q(J,e=>{e&&b.showError(e)}),Q(f,e=>{e&&b.showError(e)}),Q(V,e=>{e&&b.showError(e)}),Q(K,e=>{e&&b.showError(e)});function x(e){E.setPendingAuthSession({token:"",token_field:"pending_oauth_token",provider:"linuxdo",redirect:M(e||B.value)})}function ve(){E.clearPendingAuthSession()}function De(){const e=typeof window<"u"?window.location.hash:"",t=e.startsWith("#")?e.slice(1):e;return new URLSearchParams(t)}function qe(e){var C,d,m,ke;const t=((C=e.get("access_token"))==null?void 0:C.trim())||"";if(!t)return null;const a={access_token:t},u=((d=e.get("refresh_token"))==null?void 0:d.trim())||"";u&&(a.refresh_token=u);const c=Number.parseInt(((m=e.get("expires_in"))==null?void 0:m.trim())||"",10);Number.isFinite(c)&&c>0&&(a.expires_in=c);const A=((ke=e.get("token_type"))==null?void 0:ke.trim())||"";return A&&(a.token_type=A),a}function M(e){return!e||!e.startsWith("/")||e.startsWith("//")||e.includes("://")||e.includes(`
2`)||e.includes("\r")?"/dashboard":e}function j(){return{adoptDisplayName:z.value,adoptAvatar:H.value}}function ne(e){const t={};return typeof e.adoptDisplayName=="boolean"&&(t.adopt_display_name=e.adoptDisplayName),typeof e.adoptAvatar=="boolean"&&(t.adopt_avatar=e.adoptAvatar),t}function he(e){ee.value=e.adoption_required===!0,N.value=e.suggested_display_name||"",S.value=e.suggested_avatar_url||"",N.value||(z.value=!1),S.value||(H.value=!1)}function Le(e){return!!(e.suggested_display_name||e.suggested_avatar_url)}function Re(e){return(e==null?void 0:e.trim().toLowerCase())||""}function Ee(e){return(e.pending_email||e.existing_account_email||e.email||e.resolved_email||e.suggested_email||"").trim()}function Be(e){const t=Re(e.step||e.error||e.intent);return t==="choice"||t==="choose_account_action_required"||t==="choose_account_action"||t==="choose_account"||t==="choose"?"choose_account_action":t==="email_required"||t==="create_account_required"||t==="create_account"?"create_account":t==="bind_login_required"||t==="bind_login"||t==="existing_account"||t==="existing_account_required"||t==="existing_account_binding_required"||t==="adopt_existing_user_by_email"?"bind_login":"none"}function _e(e){const t=Be(e);g.value=t,f.value="",W.value=!1,$.value="",D.value="",V.value="",ae.value="";const a=Ee(e);if(t==="choose_account_action"){w.value=a,p.value=a,T.value="",P.value=!1;return}if(t==="create_account"){w.value=a,P.value=!0;return}if(t==="bind_login"){p.value=a,T.value="",P.value=!1;return}P.value=!1}function ge(e){return e.requires_2fa!==!0||!e.temp_token?!1:(g.value="none",k.value=!1,y.value=!1,W.value=!0,$.value=e.temp_token,D.value="",V.value="",ae.value=e.user_email_masked||"",h.value=!1,!0)}function oe(e){g.value="bind_login",p.value=p.value.trim()||(e==null?void 0:e.trim())||w.value.trim(),T.value="",f.value="",P.value=!0}function pe(){g.value="create_account",w.value=w.value.trim()||p.value.trim(),f.value=""}function U(e,t){var u,c,A,C;const a=e;return((c=(u=a.response)==null?void 0:u.data)==null?void 0:c.detail)||((C=(A=a.response)==null?void 0:A.data)==null?void 0:C.message)||a.message||t}function Ne(e){var u;const t=(u=e.response)==null?void 0:u.data,a=[t==null?void 0:t.reason,t==null?void 0:t.error,t==null?void 0:t.code,t==null?void 0:t.step,t==null?void 0:t.intent].map(c=>c==null?void 0:c.trim().toLowerCase()).filter(c=>!!c);return a.includes("email_exists")||a.includes("bind_login_required")||a.includes("bind_login")||a.includes("adopt_existing_user_by_email")||a.includes("existing_account_required")||a.includes("existing_account_binding_required")}async function fe(e,t){if(je(e)==="bind"){const a=M(e.redirect||"/profile");ve(),Z(),b.showSuccess(Pe),await I.replace(a);return}if(!Ge(e))throw new Error(n("auth.linuxdo.callbackMissingToken"));Ae(e),await E.setToken(e.access_token),Z(),b.showSuccess(n("auth.loginSuccess")),await I.replace(t)}async function G(e){he(e);const t=M(e.redirect||B.value);if(e.error==="invitation_required"){g.value="none",k.value=!0,y.value=!1,h.value=!1,x(t);return}if(ge(e)){x(t);return}if(_e(e),g.value!=="none"){k.value=!1,y.value=!1,h.value=!1,x(t);return}if(e.auth_result==="pending_session"){k.value=!1,y.value=!1,h.value=!1,x(t);return}await fe(e,t)}async function me(){var e,t;if(J.value="",!!F.value.trim()){i.value=!0;try{const a=Te(),u=j(),c=te.value?(await re.post("/auth/oauth/linuxdo/complete-registration",{pending_oauth_token:te.value,invitation_code:F.value.trim(),...Se(a),...ne(u)})).data:a?await Fe(F.value.trim(),u,a):await Fe(F.value.trim(),u);await G(c)}catch(a){const u=a;J.value=((t=(e=u.response)==null?void 0:e.data)==null?void 0:t.message)||u.message||n("auth.linuxdo.completeRegistrationFailed")}finally{i.value=!1}}}async function Ve(){i.value=!0;try{const e=await Ce(j());await G(e)}catch(e){K.value=U(e,n("auth.loginFailed")),y.value=!1}finally{i.value=!1}}async function Me(e){if(f.value="",!(!e.email||!e.password)){i.value=!0;try{const{data:t}=await re.post("/auth/oauth/pending/create-account",{email:e.email,password:e.password,verify_code:e.verifyCode||void 0,...e.turnstileToken?{turnstile_token:e.turnstileToken}:{},...e.tencentCaptchaTicket?{tencent_captcha_ticket:e.tencentCaptchaTicket,tencent_captcha_randstr:e.tencentCaptchaRandstr}:{},invitation_code:e.invitationCode||void 0,...Se(Te()),...ne(j())});await G(t)}catch(t){if(Ne(t)){oe(e.email.trim());return}f.value=U(t,n("auth.loginFailed"))}finally{i.value=!1}}}async function se(){f.value="";const e=p.value.trim(),t=T.value;if(!(!e||!t)){i.value=!0;try{const{data:a}=await re.post("/auth/oauth/pending/bind-login",{email:e,password:t,...ne(j())});await G(a)}catch(a){f.value=U(a,n("auth.loginFailed"))}finally{i.value=!1}}}async function be(){V.value="";const e=D.value.trim();if(!(!$.value||e.length!==6)){i.value=!0;try{const t=await Qe({temp_token:$.value,totp_code:e});await E.setToken(t.access_token),Z(),b.showSuccess(n("auth.loginSuccess")),await I.replace(B.value)}catch(t){V.value=U(t,n("auth.loginFailed"))}finally{i.value=!1}}}return Oe(async()=>{var C;const e=De(),t=qe(e),a=((C=e.get("pending_oauth_token"))==null?void 0:C.trim())||"",u=e.get("error"),c=e.get("error_description")||e.get("error_message")||"",A=M(e.get("redirect")||le.query.redirect||"/dashboard");try{if(t){Ae(t),await E.setToken(t.access_token),Z(),b.showSuccess(n("auth.loginSuccess")),await I.replace(A);return}if(u==="invitation_required"&&a){te.value=a,B.value=A,k.value=!0,h.value=!1;return}if(u){K.value=c||u,h.value=!1;return}const d=await Ce(),m=M(d.redirect||le.query.redirect||"/dashboard");if(he(d),B.value=m,d.error==="invitation_required"){k.value=!0,h.value=!1,x(m);return}if(ge(d)){x(m);return}if(_e(d),g.value!=="none"){h.value=!1,x(m);return}if(ee.value&&Le(d)){y.value=!0,h.value=!1,x(m);return}await fe(d,m)}catch(d){ve(),K.value=U(d,n("auth.loginFailed")),h.value=!1}}),(e,t)=>(v(),ze(s(Ye),null,{default:ye(()=>[o("div",et,[o("div",tt,[o("h2",at,l(s(n)("auth.linuxdo.callbackTitle")),1),o("p",nt,l(h.value?s(n)("auth.linuxdo.callbackProcessing"):s(n)("auth.linuxdo.callbackHint")),1)]),we(He,{name:"fade"},{default:ye(()=>[k.value||y.value||ce.value||ue.value||de.value||W.value?(v(),_("div",ot,[ee.value&&(N.value||S.value)?(v(),_("div",st,[o("div",it,[o("div",rt,[o("p",lt,l(s(n)("auth.oauth
2Flow.profileDetailsTitle",{providerName:R})),1),o("p",ut,l(s(n)("auth.oauthFlow.profileDetailsDescription",{providerName:R})),1)]),N.value?(v(),_("label",ct,[L(o("input",{"onUpdate:modelValue":t[0]||(t[0]=a=>z.value=a),type:"checkbox",class:"mt-1 h-4 w-4"},null,512),[[xe,z.value]]),o("span",dt,[o("span",vt,l(s(n)("auth.oauthFlow.useDisplayName")),1),o("span",ht,l(N.value),1)])])):q("",!0),S.value?(v(),_("label",_t,[L(o("input",{"onUpdate:modelValue":t[1]||(t[1]=a=>H.value=a),type:"checkbox",class:"mt-1 h-4 w-4"},null,512),[[xe,H.value]]),o("img",{src:S.value,alt:s(n)("auth.oauthFlow.avatarAlt",{providerName:R}),class:"h-10 w-10 rounded-full border border-gray-200 object-cover dark:border-dark-600"},null,8,gt),o("span",pt,[o("span",ft,l(s(n)("auth.oauthFlow.useAvatar")),1),o("span",mt,l(S.value),1)])])):q("",!0)])])):q("",!0),k.value?(v(),_(O,{key:1},[o("p",bt,l(s(n)("auth.linuxdo.invitationRequired")),1),o("div",null,[L(o("input",{"onUpdate:modelValue":t[2]||(t[2]=a=>F.value=a),type:"text",class:"input w-full",placeholder:s(n)("auth.invitationCodePlaceholder"),disabled:i.value,onKeyup:Y(me,["enter"])},null,40,kt),[[X,F.value]])]),o("button",{class:"btn btn-primary w-full",disabled:i.value||!F.value.trim(),onClick:me},l(i.value?s(n)("auth.linuxdo.completing"):s(n)("auth.linuxdo.completeRegistration")),9,yt)],64)):y.value?(v(),_(O,{key:2},[o("p",wt,l(s(n)("auth.oauthFlow.reviewProfileBeforeContinue",{providerName:R})),1),o("button",{class:"btn btn-primary w-full",disabled:i.value,onClick:Ve},l(i.value?s(n)("common.processing"):s(n)("auth.continue")),9,xt)],64)):ce.value?(v(),_("div",At,[o("div",Ct,[o("div",Ft,[o("p",Tt,l(s(n)("auth.oauthFlow.chooseHowToContinue")),1),o("p",St,l(w.value?s(n)("auth.oauthFlow.suggestedEmail",{email:w.value}):s(n)("auth.oauthFlow.chooseAccountActionHint")),1)]),o("div",Pt,[o("button",{class:"btn btn-secondary w-full",disabled:i.value,onClick:t[3]||(t[3]=a=>oe())},l(s(n)("auth.oauthFlow.bindExistingAccount")),9,Dt),o("button",{class:"btn btn-primary w-full",disabled:i.value,onClick:pe},l(s(n)("auth.oauthFlow.createNewAccount")),9,qt)])])])):ue.value?(v(),_(O,{key:4},[o("p",Lt,l(s(n)("auth.oauthFlow.createAccountHint")),1),we(Ze,{"test-id-prefix":"linuxdo","initial-email":w.value,"is-submitting":i.value,"error-message":f.value,onSubmit:Me,onSwitchToBind:oe},null,8,["initial-email","is-submitting","error-message"])],64)):de.value?(v(),_(O,{key:5},[o("p",Rt,l(s(n)("auth.oauthFlow.bindLoginHint",{providerName:R})),1),o("div",Et,[L(o("input",{"onUpdate:modelValue":t[4]||(t[4]=a=>p.value=a),"data-testid":"linuxdo-bind-login-email",type:"email",class:"input w-full",placeholder:s(n)("auth.emailPlaceholder"),disabled:i.value,onKeyup:Y(se,["enter"])},null,40,Bt),[[X,p.value]]),L(o("input",{"onUpdate:modelValue":t[5]||(t[5]=a=>T.value=a),"data-testid":"linuxdo-bind-login-password",type:"password",class:"input w-full",placeholder:s(n)("auth.passwordPlaceholder"),disabled:i.value,onKeyup:Y(se,["enter"])},null,40,Nt),[[X,T.value]]),o("button",{"data-testid":"linuxdo-bind-login-submit",class:"btn btn-primary w-full",disabled:i.value||!p.value.trim()||!T.value,onClick:se},l(i.value?s(n)("common.processing"):s(n)("auth.oauthFlow.logInAndBind")),9,Vt),P.value?(v(),_("button",{key:0,class:"btn btn-secondary w-full",disabled:i.value,onClick:pe},l(s(n)("auth.oauthFlow.useDifferentEmail")),9,Mt)):q("",!0)])],64)):W.value?(v(),_(O,{key:6},[o("p",Ut,l(s(n)("auth.oauthFlow.totpHint",{providerName:R,account:ae.value||s(n)("auth.oauthFlow.yourAccount")})),1),o("div",Ot,[L(o("input",{"onUpdate:modelValue":t[6]||(t[6]=a=>D.value=a),"data-testid":"linuxdo-bind-login-totp",type:"text",inputmode:"numeric",maxlength:"6",class:"input w-full",placeholder:"123456",disabled:i.value,onKeyup:Y(be,["enter"])},null,40,It),[[X,D.value]]),o("button",{"data-testid":"linuxdo-bind-login-totp-submit",class:"btn btn-primary w-full",disabled:i.value||D.value.trim().length!==6,onClick:be},l(i.value?s(n)("common.processing"):s(n)("auth.oauthFlow.verifyAndContinue")),9,Kt)])],64)):q("",!0)])):q("",!0)]),_:1})])]),_:1}))}}),aa=Xe(zt,[["__scopeId","data-v-42881a90"]]);export{aa as default};

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.