UNPKG

astro-kinde

Version:

Astro integration module for Kinde authentication

2 lines 698 B
import"astro";function o(t=16){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";return Array.from({length:t},()=>e[Math.floor(Math.random()*e.length)]).join("")}function a(t){t.state=o();let e=`${t.domain}/oauth2/auth`,r={client_id:t.clientId,redirect_uri:t.callbackUri,response_type:t.responseType,scope:t.scope,state:t.state},{clientId:n,callbackUri:p,responseType:u,scope:l,state:m,...s}=t,c=new URLSearchParams({...r,...s});return`${e}?${c.toString()}`}import i from"virtual:kinde-integration/config";var g=async({redirect:t,url:e})=>{let r=Object.fromEntries(e.searchParams),n=a({...i,prompt:"login",...r});return t(n)};export{g as GET}; //# sourceMappingURL=login.js.map