PageSourceSearch

https://tradermake.money/app2/assets/OauthConsent-CRJP89sT.js

js tradermake.money collected 2026-09-28 08:50:54 UTC 6,760 bytes, 1 lines download raw bytes

1import{k as W,o as I,c as M,i as Y,q as K,r as R,v as Q,w as X,l as V}from"./index-WNMExk3R.js";import{_ as $}from"./TWCheckboxWithLabel.vue_vue_type_script_setup_true_lang-BcFLMnrN.js";import{O as z,S as G,a as J,b as Z}from"./scopes-B9U_gcZw.js";import{d as tt,o as et,N as r,y as d,a0 as c,m as p,a9 as k,aa as l,v as o,F as P,O as n,P as w,X as S,c as h,M as u}from"./vendor-i18n-DQzTu88D.js";import"./vendor-lodash-BfNcVl0A.js";import"./vendor-protobuf-4xvfmend.js";import"./TWCheckbox.vue_vue_type_script_setup_true_lang-Dnsvx-4D.js";const at=["client_id","redirect_uri","scope","state","code_challenge","code_challenge_method","resource","response_type"];function st(E){const a={};for(const y of at){const v=E[y],s=Array.isArray(v)?v[0]:v;typeof s=="string"&&(a[y]=s)}return a}const ot={class:"tw-flex tw-flex-1 tw-items-center tw-justify-center tw-px-4 tw-py-8"},lt={key:0,class:"tw-flex tw-items-center tw-gap-3 tw-py-6 tw-text-fg-subtle","data-test":"oauth-consent-loading"},nt={class:"tw-mt-2"},ut={class:"tw-flex tw-items-start tw-gap-3"},it=["src"],rt={key:1,class:"tw-w-10 tw-h-10 tw-rounded-md tw-bg-surface-sunken tw-flex tw-items-center tw-justify-center tw-shrink-0"},dt={class:"tw-min-w-0"},ct={class:"tw-text-fg-subtle tw-leading-tight"},wt={class:"tw-text-lg tw-font-bold tw-font-mono tw-break-all tw-leading-tight","data-test":"oauth-client-host"},ht={key:0,class:"tw-text-fg-subtle tw-leading-tight tw-mt-1 tw-break-words","data-test":"oauth-client-name"},_t={class:"tw-font-bold"},vt={class:"tw-leading-tight"},pt={class:"tw-mt-4 tw-flex tw-flex-col tw-gap-1 tw-bg-surface-sunken tw-rounded-md tw-px-3 tw-py-2"},ft={class:"tw-text-fg-subtle tw-leading-tight"},gt=["title"],mt={key:1,class:"tw-mt-4 tw-text-fg-subtle tw-leading-tight","data-test":"oauth-already-granted"},yt={class:"tw-mt-5 tw-flex tw-flex-col tw-gap-2"},bt={class:"tw-font-bold"},kt={key:2,class:"tw-flex tw-items-start tw-gap-2 tw-text-fg-subtle tw-leading-tight tw-px-[16px]","data-test":"oauth-scope-offline"},xt={class:"tw-mt-1"},Ct={key:2,class:"tw-mt-3 tw-text-danger tw-leading-tight","data-test":"oauth-submit-error"},Rt=tt({__name:"OauthConsent",setup(E){const{t:a}=W(),y=M(),v=st(y.query),s=p(null),x=p(!0),f=p(null),g=p(null),_=p(null),C=p(!0),T=h(()=>{var e;return((e=s.value)==null?void 0:e.client_verified)===!1}),q=h(()=>{var e,t;return((e=s.value)==null?void 0:e.client_host)||((t=s.value)==null?void 0:t.redirect_host)||""}),D=h(()=>{var e;return!!((e=s.value)!=null&&e.logo_uri)&&!T.value}),b=h(()=>{var e,t;return T.value&&((e=s.value)!=null&&e.is_loopback)?{test:"oauth-unverified-loopback-warning",title:"oauth.unverifiedLoopbackTitle",body:"oauth.unverifiedLoopbackBody"}:T.value?{test:"oauth-unverified-warning",title:"oauth.unverifiedTitle",body:"oauth.unverifiedBody"}:(t=s.value)!=null&&t.is_loopback?{test:"oauth-loopback-warning",title:"oauth.loopbackTitle",body:"oauth.loopbackBody"}:null}),O=e=>{var t,i;return!!((i=(t=s.value)==null?void 0:t.scopes)!=null&&i.includes(e))},F=h(()=>O(J)),L=h(()=>O(G)),U=h(()=>O(Z)),j=h(()=>{var e;return(((e=s.value)==null?void 0:e.scopes)??[]).filter(t=>t!==G||C.value)});function N(e){var i,m;const t=(m=(i=e==null?void 0:e.response)==null?void 0:i.data)==null?void 0:m.message;return typeof t=="string"&&t?t:a("oauth.errorGeneric")}async function H(){var e;x.value=!0,f.value=null;try{const t=await z.authorizeContext(v);s.value=((e=t.data)==null?void 0:e.data)??null,s.value||(f.value=a("oauth.errorGeneric"))}catch(t){f.value=N(t)}finally{x.value=!1}}async function B(e){var t,i;if(!_.value){_.value=e?"approve":"deny",g.value=null;try{const A=(i=(t=(await z.authorize({...v,approved:e,scopes:e?j.value:[]})).data)==null?void 0:t.data)==null?void 0:i.redirect_to;if(!A){g.value=a("oauth.errorGeneric");return}window.location.replace(A)}catch(m){g.value=N(m)}finally{_.value=null}}}return et(H),(e,t)=>(u(),r("div",ot,[d(I,{class:"tw-w-full tw-max-w-[560px] tw-rounded-lg"},{default:c(()=>[x.value?(u(),r("div",lt,[d(Y,{size:20}),k(" "+l(o(a)("oauth.loading")),1)])):f.value?(u(),r(P,{key:1},[d(K,{"data-test":"oauth-consent-error"},{default:c(()=>[k(l(o(a)("oauth.errorTitle")),1)]),_:1}),d(R,null,{default:c(()=>[n("p",null,l(f.value),1),n("p",nt,l(o(a)("oauth.errorHint")),1)]),_:1})],64)):s.value?(u(),r(P,{key:2},[n("div",ut,[D.value?(u(),r("img",{key:0,src:s.value.logo_uri,alt:"",referrerpolicy:"no-referrer",class:"tw-w-10 tw-h-10 tw-rounded-md tw-object-contain tw-shrink-0"},null,8,it)):(u(),r("div",rt,[...t[3]||(t[3]=[n("span",{class:"tw-icon-[ph--plugs] tw-w-5 tw-h-5 tw-text-fg-subtle"},null,-1)])])),n("div",dt,[n("div",ct,l(o(a)("oauth.requestedBy")),1),n("div",wt,l(q.value),1),s.value.client_name?(u(),r("div",ht,l(o(a)("oauth.nameClaim",{name:s.value.client_name})),1)):w("",!0)])]),b.value?(u(),S(Q,{key:0,class:"tw-mt-4","data-test":b.value.test},{default:c(()=>[n("div",_t,l(o(a)(b.value.title)),1),n("div",vt,l(o(a)(b.value.body)),1)]),_:1},8,["data-test"])):w("",!0),n("div",pt,[n("span",ft,l(o(a)("oauth.redirectsTo")),1),n("span",{class:"tw-font-mono tw-break-all",title:s.value.redirect_uri,"data-test":"oauth-redirect-host"},l(s.value.redirect_host),9,gt)]),s.value.already_granted?(u(),r("div",mt,l(o(a)("oauth.alreadyGranted")),1)):w("",!0),n("div",yt,[n("div",bt,l(o(a)("oauth.grantsTitle")),1),F.value?(u(),S($,{key:0,"model-value":!0,disabled:"",label:o(a)("oauth.scopeTrades"),"label-hint":o(a)("oauth.scopeRequired"),"data-test":"oauth-scope-trades"},null,8,["label","label-hint"])):w("",!0),L.value?(u(),S($,{key:1,modelValue:C.value,"onUpdate:modelValue":t[0]||(t[0]=i=>C.value=i),label:o(a)("oauth.scopeNotes"),"label-hint":o(a)("oauth.scopeOptional"),"data-test":"oauth-scope-notes"},null,8,["modelValue","label","label-hint"])):w("",!0),U.value?(u(),r("div",kt,[t[4]||(t[4]=n("span",{class:"tw-icon-[ph--clock-clockwise] tw-w-5 tw-h-5 tw-shrink-0"},null,-1)),n("span",null,l(o(a)("oauth.scopeOffline")),1)])):w("",!0)]),d(R,{class:"tw-text-fg-subtle tw-leading-tight"},{default:c(()=>[n("p",null,l(o(a)("oauth.readOnlyNote")),1),n("p",xt,l(o(a)("oauth.revokeNote")),1)]),_:1}),g.value?(u(),r("div",Ct,l(g.value),1)):w("",!0),d(X,null,{default:c(()=>[d(V,{variant:"primary",size:"lg",block:"",class:"md:!tw-w-auto",loading:_.value==="approve",disabled:_.value==="deny","data-test":"oauth-approve",onClick:t[1]||(t[1]=i=>B(!0))},{default:c(()=>[k(l(s.value.already_granted?o(a)("oauth.reconnect"):o(a)("oauth.approve")),1)]),_:1},8,["loading","disabled"]),d(V,{variant:"text",size:"lg",block:"",class:"md:!tw-w-auto",loading:_.value==="deny",disabled:_.value==="approve","data-test":"oauth-deny",onClick:t[2]||(t[2]=i=>B(!1))},{default:c(()=>[k(l(o(a)("oauth.deny")),1)]),_:1},8,["loading","disabled"])]),_:1})],64)):w("",!0)]),_:1})]))}});
1export{Rt 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.