PageSourceSearch

https://baku89.com/_nuxt/g1qxulJL.js

js baku89.com collected 2026-10-03 19:13:03 UTC 4,262 bytes, 1 lines download raw bytes

1import{R,S as U,T as N,ah as k,ai as T,k as n,N as i,K as t,J as p,a8 as c,aj as d,L as g,M as w,E as y,ak as x,al as I,n as o,am as D}from"./8EojVNpW.js";import{u as H,e as V,s as B}from"./DMOGcgjC.js";const M={class:"OAuthAuthorize"},J={key:0,class:"OAuthAuthorize__error"},K={class:"OAuthAuthorize__summary"},W={key:0,class:"OAuthAuthorize__error"},j={class:"OAuthAuthorize__actions"},F=["disabled"],$=["disabled"],G={class:"OAuthAuthorize__logins"},Q={key:0},X=["href"],Y={key:0,class:"OAuthAuthorize__error"},se=R({__name:"oauth-authorize",setup(Z){const a=U(),A=N(),{loggedIn:S}=k(),r=p(()=>({client_id:String(a.query.client_id??""),redirect_uri:String(a.query.redirect_uri??""),response_type:String(a.query.response_type??""),code_challenge:String(a.query.code_challenge??""),code_challenge_method:String(a.query.code_challenge_method??""),state:a.query.state!==void 0?String(a.query.state):void 0,scope:a.query.scope!==void 0?String(a.query.scope):void 0})),b=p(()=>{try{const e=r.value.client_id.split(".")[0]??"",s=JSON.parse(atob(e.replace(/-/g,"+").replace(/_/g,"/")));return{name:typeof s.client_name=="string"?s.client_name:null}}catch{return{name:null}}}),m=p(()=>{try{return new URL(r.value.redirect_uri).host}catch{return null}}),f=p(()=>{const e=r.value;return!e.client_id||!e.redirect_uri?"Missing client_id / redirect_uri":e.response_type!=="code"?"Unsupported response_type":e.code_challenge_method!=="S256"||!e.code_challenge?"PKCE (S256) is required":null}),h=y(!1),_=y(null);async function O(){h.value=!0,_.value=null;try{const e=await $fetch("/.garden/oauth/approve",{method:"POST",body:{client_id:r.value.client_id,redirect_uri:r.value.redirect_uri,code_challenge:r.value.code_challenge,code_challenge_method:"S256",state:r.value.state,scope:r.value.scope}});window.location.replace(e.redirect_to)}catch(e){_.value=e instanceof Error?e.message:"Authorization failed",h.value=!1}}function q(){try{const e=new URL(r.value.redirect_uri);e.searchParams.set("error","access_denied"),r.value.state!==void 0&&e.searchParams.set("state",r.value.state),window.location.replace(e.toString())}catch{window.history.back()}}const z=T("garden.postLoginRedirect",{path:"/"});function E(e){return D(e)}function P(){z.value=a.fullPath}const{fetch:C}=k(),v=H({authenticateEndpoint:"/.garden/auth/webauthn/authenticate"}),u=y(null);async function L(){u.value=null;try{await v.authenticate(),await C()}catch(e){if(e instanceof DOMException&&e.name==="NotAllowedError")return;const s=V(e);if(s){const l=await B(s);u.value=l?"解除済みのパスキーだったため、この端末から削除しました。ソーシャルログイン後に登録し直してください / That passkey was no longer registered, so it was removed from this device. Log in below and register a new one.":"このパスキーは解除済みです。ソーシャルログインで続行してください / That passkey is no longer registered. Continue with a social login below."}else u.value=e instanceof Error?e.message:"Passkey login failed"}}return(e,s)=>(o(),n("div",M,[s[2]||(s[2]=i("h1",{class:"OAuthAuthorize__title"},"Connect to this garden",-1)),t(f)?(o(),n("p",J,c(t(f)),1)):(o(),n(d,{key:1},[i("p",K,[i("strong",null,c(t(b).name??"An application"),1),t(m)?(o(),n(d,{key:0},[w(" ("+c(t(m))+")",1)],64)):g("",!0),s[0]||(s[0]=w(" is requesting full read/write access to this garden — すべてのページの読み書き権限を要求しています。 ",-1))]),t(S)&&t(A).role==="admin"?(o(),n(d,{key:0},[t(_)?(o(),n("p",W,c(t(_)),1)):g("",!0),i("div",j,[i("button",{disabled:t(h),class:"approve",onClick:O}," 許可する / Authorize ",8,F),i("button",{disabled:t(h),class:"deny",onClick:q}," 拒否 / Deny ",8,$)])],64)):(o(),n(d,{key:1},[s[1]||(s[1]=i("p",{class:"OAuthAuthorize__summary"}," 管理者としてログインすると許可できます。 Log in as the site admin to continue: ",-1)),i("ul",G,[t(v).isSupported.value?(o(),n("li",Q,[i("button",{type:"button",class:"passkey",onClick:L}," パスキーでログイン / Sign in with a passkey ")])):g("",!0),(o(!0),n(d,null,x(t(I),l=>(o(),n("li",{key:l.id},[i("a",{href:E(l.id),onClick:P},c(l.label),9,X)]))),128))]),t(u)?(o(),n("p",Y,c(t(u)),1)):g("",!0)],64))],64))]))}});
1export{se 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.