@tempoxyz/id 0.0.0-stage → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +121 -2
- package/dist/App.d.ts +121 -0
- package/dist/App.d.ts.map +1 -0
- package/dist/App.js +132 -0
- package/dist/App.js.map +1 -0
- package/dist/app/client/.assetsignore +2 -0
- package/dist/app/client/_headers +4 -0
- package/dist/app/client/assets/Account-BYLpNFf3.css +1 -0
- package/dist/app/client/assets/Account-BllJah07.js +1 -0
- package/dist/app/client/assets/Amount-E_7snI0-.js +1 -0
- package/dist/app/client/assets/Amount-ZdtluGf-.css +1 -0
- package/dist/app/client/assets/Approval-CgV5JHlb.css +1 -0
- package/dist/app/client/assets/Approval-yKflypU2.js +1 -0
- package/dist/app/client/assets/ArrowUp-CRvqfMNU.js +1 -0
- package/dist/app/client/assets/Authentication-BAXhOh_4.js +2 -0
- package/dist/app/client/assets/BRLA-CZvVDNYr.png +0 -0
- package/dist/app/client/assets/BRZ-Cn3jEi9t.svg +1 -0
- package/dist/app/client/assets/CHFAU-DCedc4aH.png +0 -0
- package/dist/app/client/assets/Callout-B736759d.js +1 -0
- package/dist/app/client/assets/Callout-DBfEmP7q.css +1 -0
- package/dist/app/client/assets/Check-DVgD8tDG.js +1 -0
- package/dist/app/client/assets/ChevronRight-CsXtIZCB.js +1 -0
- package/dist/app/client/assets/ChooseAccount-BjxfQjPK.js +1 -0
- package/dist/app/client/assets/ChooseAccount-DL3wgJhE.css +1 -0
- package/dist/app/client/assets/Client-JrABNovb.js +1 -0
- package/dist/app/client/assets/Close-CRvWlhqc.js +1 -0
- package/dist/app/client/assets/Cloud-DgJsrqpQ.js +1 -0
- package/dist/app/client/assets/CodeInput-79Ctx8ZA.js +1 -0
- package/dist/app/client/assets/CodeInput-BqRteSwD.css +1 -0
- package/dist/app/client/assets/DLUSD-BnRXm3EI.png +0 -0
- package/dist/app/client/assets/Deposit-CclrAoXL.css +1 -0
- package/dist/app/client/assets/Deposit-c7uYn2Eb.js +1 -0
- package/dist/app/client/assets/DevTools-BYkmtuV5.css +1 -0
- package/dist/app/client/assets/DevTools-BgnzDGo2.js +1 -0
- package/dist/app/client/assets/DeviceApproval-BBUVv58e.js +1 -0
- package/dist/app/client/assets/DeviceApproval-BffFLD8F.css +1 -0
- package/dist/app/client/assets/EURAU-sjieTTB9.svg +1 -0
- package/dist/app/client/assets/EURC.e-CxYiiwkz.svg +1 -0
- package/dist/app/client/assets/Fingerprint-BNCA6qOJ.js +1 -0
- package/dist/app/client/assets/GBPA-DI_25xSG.svg +4 -0
- package/dist/app/client/assets/GUSD-BDEP2Qb-.svg +1 -0
- package/dist/app/client/assets/GeistMono-Variable-BRXCGrxA.woff2 +0 -0
- package/dist/app/client/assets/Globe-f0eWzcEI.js +1 -0
- package/dist/app/client/assets/Grant-5a-n1gJH.css +1 -0
- package/dist/app/client/assets/Grant-Dp7mpcEi.js +1 -0
- package/dist/app/client/assets/Hex-C9KeV7_9.css +1 -0
- package/dist/app/client/assets/Hex-CSp2U46W.js +10 -0
- package/dist/app/client/assets/IconChip-DpZHa1JW.js +1 -0
- package/dist/app/client/assets/IconChip-yqaQ2y_d.css +1 -0
- package/dist/app/client/assets/InputGroup-BlZvt9In.css +1 -0
- package/dist/app/client/assets/InputGroup-CsOeBnpB.js +1 -0
- package/dist/app/client/assets/Inter-cyrillic-e3OmmzmJ.woff2 +0 -0
- package/dist/app/client/assets/Inter-cyrillic-ext-DOWZeO4Q.woff2 +0 -0
- package/dist/app/client/assets/Inter-greek-BD3ujQlX.woff2 +0 -0
- package/dist/app/client/assets/Inter-greek-ext-CXEwbus4.woff2 +0 -0
- package/dist/app/client/assets/Inter-latin-BDFm4vTb.woff2 +0 -0
- package/dist/app/client/assets/Inter-latin-ext-E7a9JEPe.woff2 +0 -0
- package/dist/app/client/assets/Inter-symbols-DEch7Rxr.woff2 +0 -0
- package/dist/app/client/assets/Inter-vietnamese-Bg9723vR.woff2 +0 -0
- package/dist/app/client/assets/Loader-Cm9YJNNJ.js +1 -0
- package/dist/app/client/assets/MACH-sK0r79kQ.svg +4 -0
- package/dist/app/client/assets/OUSD-BFXgVo-Z.svg +5 -0
- package/dist/app/client/assets/OUSD.dark-BbbjMvA1.svg +17 -0
- package/dist/app/client/assets/OUSD.light-B_zpSz_c.svg +17 -0
- package/dist/app/client/assets/PRIME-CiFp2-3e.svg +14 -0
- package/dist/app/client/assets/PopoverPopup-DprRXRQe.js +1 -0
- package/dist/app/client/assets/Rows-DPGTUdA8.css +1 -0
- package/dist/app/client/assets/Rows-Qqo3evtk.js +1 -0
- package/dist/app/client/assets/SBC-BTYkbkiD.svg +1 -0
- package/dist/app/client/assets/SEKAU-CB5Fc6o8.svg +5 -0
- package/dist/app/client/assets/Separator-CZUjVQOL.js +1 -0
- package/dist/app/client/assets/SignIn-HdaDzFmq.js +1 -0
- package/dist/app/client/assets/SignIn-mlBTwUq4.css +1 -0
- package/dist/app/client/assets/Stack-CkkvkOzj.js +1 -0
- package/dist/app/client/assets/Stack-D7Yt22Ed.css +1 -0
- package/dist/app/client/assets/Tag-BMh6ajrW.css +1 -0
- package/dist/app/client/assets/Tag-CLOVANTX.js +1 -0
- package/dist/app/client/assets/ToolbarRootContext-Zty_Dh3J.js +1 -0
- package/dist/app/client/assets/Tooltip-CLATV6YU.js +1 -0
- package/dist/app/client/assets/Tooltip-d3y9ESUJ.css +1 -0
- package/dist/app/client/assets/USD1-COVcO_PB.svg +30 -0
- package/dist/app/client/assets/USDB-Ckwb6UQw.svg +11 -0
- package/dist/app/client/assets/USDC.e-3nMsKAMC.svg +1 -0
- package/dist/app/client/assets/USDT0-ia60Dw0e.svg +1 -0
- package/dist/app/client/assets/USDY-CB4iet2q.svg +16 -0
- package/dist/app/client/assets/USDe-BXHQCd92.svg +1 -0
- package/dist/app/client/assets/Upgrade-D0_aO5AP.js +1 -0
- package/dist/app/client/assets/WalletUpgrade-BPsPNQsd.js +1 -0
- package/dist/app/client/assets/WalletUpgrade-C04kW0Jl.css +1 -0
- package/dist/app/client/assets/YLDS-CRh8Zw0g.svg +3 -0
- package/dist/app/client/assets/___-I98bns4o.css +1 -0
- package/dist/app/client/assets/___.flows-XOlLwMIy.js +5 -0
- package/dist/app/client/assets/alphaUSD-CpCFoVuh.svg +1 -0
- package/dist/app/client/assets/authorize-C-MlCyaM.js +1 -0
- package/dist/app/client/assets/betaUSD-9A8AjgYg.svg +1 -0
- package/dist/app/client/assets/cUSD-WsQfa-iC.svg +1 -0
- package/dist/app/client/assets/cbBTC-DvUDqrDi.svg +1 -0
- package/dist/app/client/assets/choose-account-nXR-SKa2.js +1 -0
- package/dist/app/client/assets/deposit-G8tiLPN4.js +1 -0
- package/dist/app/client/assets/device-BojBF7hZ.js +1 -0
- package/dist/app/client/assets/error-KiOpX7GD.js +1 -0
- package/dist/app/client/assets/frxUSD-n9pTpinR.svg +1 -0
- package/dist/app/client/assets/getPseudoElementBounds-BsLy4zf_.js +1 -0
- package/dist/app/client/assets/goUSD-D9kUvHsF.svg +5 -0
- package/dist/app/client/assets/iUSD-CWCJAq9X.svg +1 -0
- package/dist/app/client/assets/index-BZH0M7Nf.js +13 -0
- package/dist/app/client/assets/index-CIYxHmYA.css +1 -0
- package/dist/app/client/assets/login-DUjpk60p.js +1 -0
- package/dist/app/client/assets/pathUSD-BvaO6ooS.svg +25 -0
- package/dist/app/client/assets/preload-helper-Bs9KvdYl.js +1 -0
- package/dist/app/client/assets/rUSD-B-xuFS7T.svg +1 -0
- package/dist/app/client/assets/reUSD-CkIUs0Lx.svg +1 -0
- package/dist/app/client/assets/removable-DMiA3t_o.js +1 -0
- package/dist/app/client/assets/reset-co-CHrff.css +1 -0
- package/dist/app/client/assets/rolldown-runtime-WkwZ5CU-.js +1 -0
- package/dist/app/client/assets/routes-CK8cthzA.js +1 -0
- package/dist/app/client/assets/sUSDe-j9GOnH7I.svg +1 -0
- package/dist/app/client/assets/siUSD-C10QUNYS.svg +1 -0
- package/dist/app/client/assets/stcUSD-DIntDJeh.svg +1 -0
- package/dist/app/client/assets/syrupUSDC-DhYwZqdM.svg +5 -0
- package/dist/app/client/assets/thetaUSD-Dgmksf6G.svg +1 -0
- package/dist/app/client/assets/useNavigate-CB6S2u4J.js +1 -0
- package/dist/app/client/assets/useQuery-BpHfPhTT.js +1 -0
- package/dist/app/client/assets/useRegisterFieldControl-DsslqY-V.js +1 -0
- package/dist/app/client/assets/wYLDS-CaCKDrO-.svg +10 -0
- package/dist/app/client/assets/wsrUSD-B2Ey0bDQ.svg +1 -0
- package/dist/app/client/assets/zyzz-DYC-X0_B.css +1 -0
- package/dist/app/client/assets/zyzz.config-DX_D_7j3.js +2 -0
- package/dist/app/db/auth.d.ts +3412 -0
- package/dist/app/db/auth.d.ts.map +1 -0
- package/dist/app/db/auth.js +349 -0
- package/dist/app/db/auth.js.map +1 -0
- package/dist/app/db/schema.d.ts +1091 -0
- package/dist/app/db/schema.d.ts.map +1 -0
- package/dist/app/db/schema.js +183 -0
- package/dist/app/db/schema.js.map +1 -0
- package/dist/app/db/table.d.ts +8 -0
- package/dist/app/db/table.d.ts.map +1 -0
- package/dist/app/db/table.js +28 -0
- package/dist/app/db/table.js.map +1 -0
- package/dist/app/server/.vite/manifest.json +2093 -0
- package/dist/app/server/assets/Account-BYLpNFf3.css +1 -0
- package/dist/app/server/assets/Account-G_SUeRU3.js +2 -0
- package/dist/app/server/assets/Account-G_SUeRU3.js.map +1 -0
- package/dist/app/server/assets/Amount-Cgwdr3Xt.js +2 -0
- package/dist/app/server/assets/Amount-Cgwdr3Xt.js.map +1 -0
- package/dist/app/server/assets/Amount-ZdtluGf-.css +1 -0
- package/dist/app/server/assets/Approval-CgV5JHlb.css +1 -0
- package/dist/app/server/assets/Approval-DvkB9tWA.js +2 -0
- package/dist/app/server/assets/Approval-DvkB9tWA.js.map +1 -0
- package/dist/app/server/assets/ArrowUp-DpK_zNgZ.js +2 -0
- package/dist/app/server/assets/ArrowUp-DpK_zNgZ.js.map +1 -0
- package/dist/app/server/assets/Authentication-BOkhlNQu.js +2 -0
- package/dist/app/server/assets/Authentication-BOkhlNQu.js.map +1 -0
- package/dist/app/server/assets/Authentication-C3oNZAVX.js +2 -0
- package/dist/app/server/assets/Authentication-C3oNZAVX.js.map +1 -0
- package/dist/app/server/assets/BRLA-CZvVDNYr.png +0 -0
- package/dist/app/server/assets/BRZ-Cn3jEi9t.svg +1 -0
- package/dist/app/server/assets/Bytes-C7CRVS3J.js +4 -0
- package/dist/app/server/assets/Bytes-C7CRVS3J.js.map +1 -0
- package/dist/app/server/assets/CHFAU-DCedc4aH.png +0 -0
- package/dist/app/server/assets/Callout-DBfEmP7q.css +1 -0
- package/dist/app/server/assets/Callout-tQoAitWq.js +2 -0
- package/dist/app/server/assets/Callout-tQoAitWq.js.map +1 -0
- package/dist/app/server/assets/ChainList-C4A_7e-9.js +6 -0
- package/dist/app/server/assets/ChainList-C4A_7e-9.js.map +1 -0
- package/dist/app/server/assets/ChainName-BMnJyJrd.js +2 -0
- package/dist/app/server/assets/ChainName-BMnJyJrd.js.map +1 -0
- package/dist/app/server/assets/Check-DU_oR3Ev.js +2 -0
- package/dist/app/server/assets/Check-DU_oR3Ev.js.map +1 -0
- package/dist/app/server/assets/ChevronRight-DTBnw-W6.js +2 -0
- package/dist/app/server/assets/ChevronRight-DTBnw-W6.js.map +1 -0
- package/dist/app/server/assets/ChooseAccount-BizJvMrY.js +2 -0
- package/dist/app/server/assets/ChooseAccount-BizJvMrY.js.map +1 -0
- package/dist/app/server/assets/ChooseAccount-DL3wgJhE.css +1 -0
- package/dist/app/server/assets/Client-Dx3KrpJZ.js +2 -0
- package/dist/app/server/assets/Client-Dx3KrpJZ.js.map +1 -0
- package/dist/app/server/assets/ClientOnly-CKLiu67O.js +2 -0
- package/dist/app/server/assets/ClientOnly-CKLiu67O.js.map +1 -0
- package/dist/app/server/assets/Close-DUeE37ev.js +2 -0
- package/dist/app/server/assets/Close-DUeE37ev.js.map +1 -0
- package/dist/app/server/assets/Cloud-CLB3rTTy.js +2 -0
- package/dist/app/server/assets/Cloud-CLB3rTTy.js.map +1 -0
- package/dist/app/server/assets/CodeInput-BqRteSwD.css +1 -0
- package/dist/app/server/assets/CodeInput-FsPzVuLU.js +2 -0
- package/dist/app/server/assets/CodeInput-FsPzVuLU.js.map +1 -0
- package/dist/app/server/assets/Credential-DFjcrdyI.js +2 -0
- package/dist/app/server/assets/Credential-DFjcrdyI.js.map +1 -0
- package/dist/app/server/assets/DLUSD-BnRXm3EI.png +0 -0
- package/dist/app/server/assets/Deposit-CclrAoXL.css +1 -0
- package/dist/app/server/assets/Deposit-ChYGRfW2.js +2 -0
- package/dist/app/server/assets/Deposit-ChYGRfW2.js.map +1 -0
- package/dist/app/server/assets/DevTools-BYkmtuV5.css +1 -0
- package/dist/app/server/assets/DevTools-ZJVXqrIK.js +2 -0
- package/dist/app/server/assets/DevTools-ZJVXqrIK.js.map +1 -0
- package/dist/app/server/assets/DeviceApproval-BffFLD8F.css +1 -0
- package/dist/app/server/assets/DeviceApproval-Bqe3Mi78.js +2 -0
- package/dist/app/server/assets/DeviceApproval-Bqe3Mi78.js.map +1 -0
- package/dist/app/server/assets/EURAU-sjieTTB9.svg +1 -0
- package/dist/app/server/assets/EURC.e-CxYiiwkz.svg +1 -0
- package/dist/app/server/assets/ExecutionError-CDszGSF1.js +9 -0
- package/dist/app/server/assets/ExecutionError-CDszGSF1.js.map +1 -0
- package/dist/app/server/assets/Fingerprint-DhOPOdRr.js +2 -0
- package/dist/app/server/assets/Fingerprint-DhOPOdRr.js.map +1 -0
- package/dist/app/server/assets/GBPA-DI_25xSG.svg +4 -0
- package/dist/app/server/assets/GUSD-BDEP2Qb-.svg +1 -0
- package/dist/app/server/assets/GeistMono-Variable-BRXCGrxA.woff2 +0 -0
- package/dist/app/server/assets/Globe-2CxqxU-7.js +2 -0
- package/dist/app/server/assets/Globe-2CxqxU-7.js.map +1 -0
- package/dist/app/server/assets/Grant-5a-n1gJH.css +1 -0
- package/dist/app/server/assets/Grant-D_tun0mF.js +2 -0
- package/dist/app/server/assets/Grant-D_tun0mF.js.map +1 -0
- package/dist/app/server/assets/Hex-C9KeV7_9.css +1 -0
- package/dist/app/server/assets/Hex-Z6m_0Y0m.js +11 -0
- package/dist/app/server/assets/Hex-Z6m_0Y0m.js.map +1 -0
- package/dist/app/server/assets/IconChip-C9ZrmGB5.js +2 -0
- package/dist/app/server/assets/IconChip-C9ZrmGB5.js.map +1 -0
- package/dist/app/server/assets/IconChip-yqaQ2y_d.css +1 -0
- package/dist/app/server/assets/InputGroup-BlZvt9In.css +1 -0
- package/dist/app/server/assets/InputGroup-hpjuLuR7.js +2 -0
- package/dist/app/server/assets/InputGroup-hpjuLuR7.js.map +1 -0
- package/dist/app/server/assets/Inter-cyrillic-e3OmmzmJ.woff2 +0 -0
- package/dist/app/server/assets/Inter-cyrillic-ext-DOWZeO4Q.woff2 +0 -0
- package/dist/app/server/assets/Inter-greek-BD3ujQlX.woff2 +0 -0
- package/dist/app/server/assets/Inter-greek-ext-CXEwbus4.woff2 +0 -0
- package/dist/app/server/assets/Inter-latin-BDFm4vTb.woff2 +0 -0
- package/dist/app/server/assets/Inter-latin-ext-E7a9JEPe.woff2 +0 -0
- package/dist/app/server/assets/Inter-symbols-DEch7Rxr.woff2 +0 -0
- package/dist/app/server/assets/Inter-vietnamese-Bg9723vR.woff2 +0 -0
- package/dist/app/server/assets/Loader-DnKC9P5p.js +2 -0
- package/dist/app/server/assets/Loader-DnKC9P5p.js.map +1 -0
- package/dist/app/server/assets/MACH-sK0r79kQ.svg +4 -0
- package/dist/app/server/assets/Match-CyVdYcSf.js +2 -0
- package/dist/app/server/assets/Match-CyVdYcSf.js.map +1 -0
- package/dist/app/server/assets/OUSD-BFXgVo-Z.svg +5 -0
- package/dist/app/server/assets/OUSD.dark-BbbjMvA1.svg +17 -0
- package/dist/app/server/assets/OUSD.light-B_zpSz_c.svg +17 -0
- package/dist/app/server/assets/PRIME-CiFp2-3e.svg +14 -0
- package/dist/app/server/assets/PopoverPopup-CwqeQelI.js +2 -0
- package/dist/app/server/assets/PopoverPopup-CwqeQelI.js.map +1 -0
- package/dist/app/server/assets/Rows-CQKQwTI1.js +2 -0
- package/dist/app/server/assets/Rows-CQKQwTI1.js.map +1 -0
- package/dist/app/server/assets/Rows-DPGTUdA8.css +1 -0
- package/dist/app/server/assets/SBC-BTYkbkiD.svg +1 -0
- package/dist/app/server/assets/SEKAU-CB5Fc6o8.svg +5 -0
- package/dist/app/server/assets/Separator-DrI7KRAs.js +2 -0
- package/dist/app/server/assets/Separator-DrI7KRAs.js.map +1 -0
- package/dist/app/server/assets/SignIn-DfeeLEmN.js +2 -0
- package/dist/app/server/assets/SignIn-DfeeLEmN.js.map +1 -0
- package/dist/app/server/assets/SignIn-mlBTwUq4.css +1 -0
- package/dist/app/server/assets/Stack-D7Yt22Ed.css +1 -0
- package/dist/app/server/assets/Stack-DGktaLZc.js +2 -0
- package/dist/app/server/assets/Stack-DGktaLZc.js.map +1 -0
- package/dist/app/server/assets/Tag-9vSRBpph.js +2 -0
- package/dist/app/server/assets/Tag-9vSRBpph.js.map +1 -0
- package/dist/app/server/assets/Tag-BMh6ajrW.css +1 -0
- package/dist/app/server/assets/ToolbarRootContext-BH_CFSWd.js +2 -0
- package/dist/app/server/assets/ToolbarRootContext-BH_CFSWd.js.map +1 -0
- package/dist/app/server/assets/Tooltip-DLX41peb.js +2 -0
- package/dist/app/server/assets/Tooltip-DLX41peb.js.map +1 -0
- package/dist/app/server/assets/Tooltip-d3y9ESUJ.css +1 -0
- package/dist/app/server/assets/USD1-COVcO_PB.svg +30 -0
- package/dist/app/server/assets/USDB-Ckwb6UQw.svg +11 -0
- package/dist/app/server/assets/USDC.e-3nMsKAMC.svg +1 -0
- package/dist/app/server/assets/USDT0-ia60Dw0e.svg +1 -0
- package/dist/app/server/assets/USDY-CB4iet2q.svg +16 -0
- package/dist/app/server/assets/USDe-BXHQCd92.svg +1 -0
- package/dist/app/server/assets/Upgrade-Dbfm2nm0.js +2 -0
- package/dist/app/server/assets/Upgrade-Dbfm2nm0.js.map +1 -0
- package/dist/app/server/assets/WalletUpgrade-C04kW0Jl.css +1 -0
- package/dist/app/server/assets/WalletUpgrade-CWKc5fYt.js +2 -0
- package/dist/app/server/assets/WalletUpgrade-CWKc5fYt.js.map +1 -0
- package/dist/app/server/assets/YLDS-CRh8Zw0g.svg +3 -0
- package/dist/app/server/assets/___-I98bns4o.css +1 -0
- package/dist/app/server/assets/___.flows-Cc-awUoC.js +6 -0
- package/dist/app/server/assets/___.flows-Cc-awUoC.js.map +1 -0
- package/dist/app/server/assets/_tanstack-start-manifest_v-U7TrtUSA.js +1 -0
- package/dist/app/server/assets/_zyzz__2Fhome_2Frunner_2Fwork_2Fid_2Fid_2Fsrc_2Fapp_2Froutes_2F_5B__5D.flows-B1pPOqsM.css +1 -0
- package/dist/app/server/assets/_zyzz__2Fhome_2Frunner_2Fwork_2Fid_2Fid_2Fsrc_2Fapp_2Froutes_2F_5B__5D.flows.tsx-CKALi9oD.js +2 -0
- package/dist/app/server/assets/_zyzz__2Fhome_2Frunner_2Fwork_2Fid_2Fid_2Fsrc_2Fapp_2Froutes_2F_5B__5D.flows.tsx-CKALi9oD.js.map +1 -0
- package/dist/app/server/assets/_zyzz_shared-BbDIEd_j.css +1 -0
- package/dist/app/server/assets/alphaUSD-CpCFoVuh.svg +1 -0
- package/dist/app/server/assets/arktype-aI7TBD0R-D1R3Byo5.js +2 -0
- package/dist/app/server/assets/arktype-aI7TBD0R-D1R3Byo5.js.map +1 -0
- package/dist/app/server/assets/async-local-storage-DlOvwxXd.js +2 -0
- package/dist/app/server/assets/async-local-storage-DlOvwxXd.js.map +1 -0
- package/dist/app/server/assets/authorize-BXzTo2Pb.js +2 -0
- package/dist/app/server/assets/authorize-BXzTo2Pb.js.map +1 -0
- package/dist/app/server/assets/authorize-BzoUqOdA.js +2 -0
- package/dist/app/server/assets/authorize-BzoUqOdA.js.map +1 -0
- package/dist/app/server/assets/authorize-DXYo-K2n-rmQQ42x1.js +56 -0
- package/dist/app/server/assets/authorize-DXYo-K2n-rmQQ42x1.js.map +1 -0
- package/dist/app/server/assets/authorize-DfjPYJqS.css +1 -0
- package/dist/app/server/assets/betaUSD-9A8AjgYg.svg +1 -0
- package/dist/app/server/assets/bun-sqlite-dialect-DoOVo4ja-CtyBkVMb.js +2 -0
- package/dist/app/server/assets/bun-sqlite-dialect-DoOVo4ja-CtyBkVMb.js.map +1 -0
- package/dist/app/server/assets/cUSD-WsQfa-iC.svg +1 -0
- package/dist/app/server/assets/call-dzi0xjZd.js +31 -0
- package/dist/app/server/assets/call-dzi0xjZd.js.map +1 -0
- package/dist/app/server/assets/cbBTC-DvUDqrDi.svg +1 -0
- package/dist/app/server/assets/ccip-DjD8z_3B.js +2 -0
- package/dist/app/server/assets/ccip-DjD8z_3B.js.map +1 -0
- package/dist/app/server/assets/choose-account-_X7xq5am.js +2 -0
- package/dist/app/server/assets/choose-account-_X7xq5am.js.map +1 -0
- package/dist/app/server/assets/choose-account-lqA5SLx9.css +1 -0
- package/dist/app/server/assets/choose-account-zm-5Qs3e.js +2 -0
- package/dist/app/server/assets/choose-account-zm-5Qs3e.js.map +1 -0
- package/dist/app/server/assets/compiled-query-Ds2NVcFT.js +2 -0
- package/dist/app/server/assets/compiled-query-Ds2NVcFT.js.map +1 -0
- package/dist/app/server/assets/convert-BIC8n32x.js +2 -0
- package/dist/app/server/assets/convert-BIC8n32x.js.map +1 -0
- package/dist/app/server/assets/cookie-DxViaO10.js +2 -0
- package/dist/app/server/assets/cookie-DxViaO10.js.map +1 -0
- package/dist/app/server/assets/core-BBrZXfrB.js +56 -0
- package/dist/app/server/assets/core-BBrZXfrB.js.map +1 -0
- package/dist/app/server/assets/d1-sqlite-dialect-m0f01-4z-Cv-csE1u.js +2 -0
- package/dist/app/server/assets/d1-sqlite-dialect-m0f01-4z-Cv-csE1u.js.map +1 -0
- package/dist/app/server/assets/decodeFunctionData-bP6V2ai4.js +2 -0
- package/dist/app/server/assets/decodeFunctionData-bP6V2ai4.js.map +1 -0
- package/dist/app/server/assets/default-u_dwuiYb-DOrMMcg9.js +2 -0
- package/dist/app/server/assets/default-u_dwuiYb-DOrMMcg9.js.map +1 -0
- package/dist/app/server/assets/deposit-BBaNI01u.js +2 -0
- package/dist/app/server/assets/deposit-BBaNI01u.js.map +1 -0
- package/dist/app/server/assets/deposit-LWS6ZTuf.js +2 -0
- package/dist/app/server/assets/deposit-LWS6ZTuf.js.map +1 -0
- package/dist/app/server/assets/deposit-oFx15XCA.css +1 -0
- package/dist/app/server/assets/device-CrXlusjr.js +2 -0
- package/dist/app/server/assets/device-CrXlusjr.js.map +1 -0
- package/dist/app/server/assets/device-DdFMgYe2.js +2 -0
- package/dist/app/server/assets/device-DdFMgYe2.js.map +1 -0
- package/dist/app/server/assets/device-tMCpu5zk.css +1 -0
- package/dist/app/server/assets/dist-CR6FW-yS.js +1 -0
- package/dist/app/server/assets/dist-CoH0hD1s.js +15 -0
- package/dist/app/server/assets/dist-CoH0hD1s.js.map +1 -0
- package/dist/app/server/assets/dist-DcICI3fd.js +2 -0
- package/dist/app/server/assets/dist-DcICI3fd.js.map +1 -0
- package/dist/app/server/assets/effect-QlVUlMFu-mXPkuQTb.js +2 -0
- package/dist/app/server/assets/effect-QlVUlMFu-mXPkuQTb.js.map +1 -0
- package/dist/app/server/assets/empty-plugin-adapters-BaGcmrjC.js +2 -0
- package/dist/app/server/assets/empty-plugin-adapters-BaGcmrjC.js.map +1 -0
- package/dist/app/server/assets/error-CXy8gqdE.css +1 -0
- package/dist/app/server/assets/error-DXDT2AHy.js +2 -0
- package/dist/app/server/assets/error-DXDT2AHy.js.map +1 -0
- package/dist/app/server/assets/error-bnVzy9tx.js +2 -0
- package/dist/app/server/assets/error-bnVzy9tx.js.map +1 -0
- package/dist/app/server/assets/esm-C6SW--yt.js +4 -0
- package/dist/app/server/assets/esm-C6SW--yt.js.map +1 -0
- package/dist/app/server/assets/factory-dvoOlKer.js +5 -0
- package/dist/app/server/assets/factory-dvoOlKer.js.map +1 -0
- package/dist/app/server/assets/frxUSD-n9pTpinR.svg +1 -0
- package/dist/app/server/assets/get-id-field-OwLpfjj2.js +6 -0
- package/dist/app/server/assets/get-id-field-OwLpfjj2.js.map +1 -0
- package/dist/app/server/assets/getPseudoElementBounds-PkWU72kn.js +2 -0
- package/dist/app/server/assets/getPseudoElementBounds-PkWU72kn.js.map +1 -0
- package/dist/app/server/assets/goUSD-D9kUvHsF.svg +5 -0
- package/dist/app/server/assets/iUSD-CWCJAq9X.svg +1 -0
- package/dist/app/server/assets/index-CLddUTqr-CC33CMvS.js +2 -0
- package/dist/app/server/assets/index-CLddUTqr-CC33CMvS.js.map +1 -0
- package/dist/app/server/assets/index-DZEfthgZ-Ec2MMQ_e.js +2 -0
- package/dist/app/server/assets/index-DZEfthgZ-Ec2MMQ_e.js.map +1 -0
- package/dist/app/server/assets/kysely-adapter-B8tQwTcu.js +1 -0
- package/dist/app/server/assets/lazyRouteComponent-DPOOPZw_.js +2 -0
- package/dist/app/server/assets/lazyRouteComponent-DPOOPZw_.js.map +1 -0
- package/dist/app/server/assets/load-server-Dr0IlySo.js +3 -0
- package/dist/app/server/assets/load-server-Dr0IlySo.js.map +1 -0
- package/dist/app/server/assets/login-BLq3tEEr.js +2 -0
- package/dist/app/server/assets/login-BLq3tEEr.js.map +1 -0
- package/dist/app/server/assets/login-DCIrAbED.js +2 -0
- package/dist/app/server/assets/login-DCIrAbED.js.map +1 -0
- package/dist/app/server/assets/login-msDnt3yT.css +1 -0
- package/dist/app/server/assets/matchContext-ByrIUj4L.js +2 -0
- package/dist/app/server/assets/matchContext-ByrIUj4L.js.map +1 -0
- package/dist/app/server/assets/node-sqlite-dialect-BowWLXvK.js +2 -0
- package/dist/app/server/assets/node-sqlite-dialect-BowWLXvK.js.map +1 -0
- package/dist/app/server/assets/pathUSD-BvaO6ooS.svg +25 -0
- package/dist/app/server/assets/rUSD-B-xuFS7T.svg +1 -0
- package/dist/app/server/assets/reUSD-CkIUs0Lx.svg +1 -0
- package/dist/app/server/assets/react-dom-DYzj0HXX.js +2 -0
- package/dist/app/server/assets/react-dom-DYzj0HXX.js.map +1 -0
- package/dist/app/server/assets/removable-BCLTvPOx.js +2 -0
- package/dist/app/server/assets/removable-BCLTvPOx.js.map +1 -0
- package/dist/app/server/assets/reset-DZWeTZeQ.js +2 -0
- package/dist/app/server/assets/reset-DZWeTZeQ.js.map +1 -0
- package/dist/app/server/assets/reset-co-CHrff.css +1 -0
- package/dist/app/server/assets/resolveError-CZXXvCJR.js +2 -0
- package/dist/app/server/assets/resolveError-CZXXvCJR.js.map +1 -0
- package/dist/app/server/assets/rolldown-runtime-BWaJ3C7D.js +1 -0
- package/dist/app/server/assets/router-Bqz5X4Qw.js +2 -0
- package/dist/app/server/assets/router-Bqz5X4Qw.js.map +1 -0
- package/dist/app/server/assets/router-CclzitkY.css +1 -0
- package/dist/app/server/assets/routes-BLQdKqcZ.js +2 -0
- package/dist/app/server/assets/routes-BLQdKqcZ.js.map +1 -0
- package/dist/app/server/assets/routes-BgiIzrOt.css +1 -0
- package/dist/app/server/assets/routes-Bv6WzsSR.js +2 -0
- package/dist/app/server/assets/routes-Bv6WzsSR.js.map +1 -0
- package/dist/app/server/assets/sUSDe-j9GOnH7I.svg +1 -0
- package/dist/app/server/assets/schema-check-oLqvHR8y.js +9 -0
- package/dist/app/server/assets/schema-check-oLqvHR8y.js.map +1 -0
- package/dist/app/server/assets/secp256k1-yg8eeIYU.js +2 -0
- package/dist/app/server/assets/secp256k1-yg8eeIYU.js.map +1 -0
- package/dist/app/server/assets/server-RRUiOef2.js +76 -0
- package/dist/app/server/assets/server-RRUiOef2.js.map +1 -0
- package/dist/app/server/assets/siUSD-C10QUNYS.svg +1 -0
- package/dist/app/server/assets/sqlite-adapter-C_LAV4e3.js +2 -0
- package/dist/app/server/assets/sqlite-adapter-C_LAV4e3.js.map +1 -0
- package/dist/app/server/assets/sqlite-introspector-DSCAP82F-Crx7Ny14.js +6 -0
- package/dist/app/server/assets/sqlite-introspector-DSCAP82F-Crx7Ny14.js.map +1 -0
- package/dist/app/server/assets/standard-json-DY77efq0.js +2 -0
- package/dist/app/server/assets/standard-json-DY77efq0.js.map +1 -0
- package/dist/app/server/assets/standard-json-ig2t0wRt.js +2 -0
- package/dist/app/server/assets/standard-json-ig2t0wRt.js.map +1 -0
- package/dist/app/server/assets/standard-json-t-LNckA6.js +2 -0
- package/dist/app/server/assets/standard-json-t-LNckA6.js.map +1 -0
- package/dist/app/server/assets/standard-openapi-CONmVRl8.js +2 -0
- package/dist/app/server/assets/standard-openapi-CONmVRl8.js.map +1 -0
- package/dist/app/server/assets/start-C63VetBp.js +2 -0
- package/dist/app/server/assets/start-C63VetBp.js.map +1 -0
- package/dist/app/server/assets/stcUSD-DIntDJeh.svg +1 -0
- package/dist/app/server/assets/sury-CWZTCd75-CDaOS2oM.js +2 -0
- package/dist/app/server/assets/sury-CWZTCd75-CDaOS2oM.js.map +1 -0
- package/dist/app/server/assets/syrupUSDC-DhYwZqdM.svg +5 -0
- package/dist/app/server/assets/thetaUSD-Dgmksf6G.svg +1 -0
- package/dist/app/server/assets/typebox-Dei93FPO-D_lCVdAz.js +2 -0
- package/dist/app/server/assets/typebox-Dei93FPO-D_lCVdAz.js.map +1 -0
- package/dist/app/server/assets/useNavigate-D6d1w7KE.js +2 -0
- package/dist/app/server/assets/useNavigate-D6d1w7KE.js.map +1 -0
- package/dist/app/server/assets/useQuery-BRpCr5vj.js +2 -0
- package/dist/app/server/assets/useQuery-BRpCr5vj.js.map +1 -0
- package/dist/app/server/assets/useRegisterFieldControl-cJesrOWK.js +2 -0
- package/dist/app/server/assets/useRegisterFieldControl-cJesrOWK.js.map +1 -0
- package/dist/app/server/assets/utils-C4ZXZIZW.js +2 -0
- package/dist/app/server/assets/utils-C4ZXZIZW.js.map +1 -0
- package/dist/app/server/assets/utils-D57zfcg-.js +2 -0
- package/dist/app/server/assets/utils-D57zfcg-.js.map +1 -0
- package/dist/app/server/assets/valibot--1zFm7rT-CIKoH3MS.js +2 -0
- package/dist/app/server/assets/valibot--1zFm7rT-CIKoH3MS.js.map +1 -0
- package/dist/app/server/assets/valibot-D_HTw1Gn-BdPyLkXt.js +2 -0
- package/dist/app/server/assets/valibot-D_HTw1Gn-BdPyLkXt.js.map +1 -0
- package/dist/app/server/assets/wYLDS-CaCKDrO-.svg +10 -0
- package/dist/app/server/assets/wsrUSD-B2Ey0bDQ.svg +1 -0
- package/dist/app/server/assets/zod-Bwrt9trS-BezI5Gi1.js +2 -0
- package/dist/app/server/assets/zod-Bwrt9trS-BezI5Gi1.js.map +1 -0
- package/dist/app/server/assets/zod-DSgpEGAE-DZ7M_Q33.js +2 -0
- package/dist/app/server/assets/zod-DSgpEGAE-DZ7M_Q33.js.map +1 -0
- package/dist/app/server/assets/zyzz-6R2K52xP.css +1 -0
- package/dist/app/server/assets/zyzz.config-CJRpjn0E.js +3 -0
- package/dist/app/server/assets/zyzz.config-CJRpjn0E.js.map +1 -0
- package/dist/app/server/index.js +532 -0
- package/dist/app/server/index.js.map +1 -0
- package/dist/app/server/wrangler.json +1 -0
- package/dist/cli/Admin.d.ts +34 -0
- package/dist/cli/Admin.d.ts.map +1 -0
- package/dist/cli/Admin.js +61 -0
- package/dist/cli/Admin.js.map +1 -0
- package/dist/cli/Apps.d.ts +9 -0
- package/dist/cli/Apps.d.ts.map +1 -0
- package/dist/cli/Apps.js +34 -0
- package/dist/cli/Apps.js.map +1 -0
- package/dist/cli/Cli.d.ts +13 -0
- package/dist/cli/Cli.d.ts.map +1 -0
- package/dist/cli/Cli.js +26 -0
- package/dist/cli/Cli.js.map +1 -0
- package/dist/cli/Project.d.ts +17 -0
- package/dist/cli/Project.d.ts.map +1 -0
- package/dist/cli/Project.js +90 -0
- package/dist/cli/Project.js.map +1 -0
- package/dist/cli/Realms.d.ts +24 -0
- package/dist/cli/Realms.d.ts.map +1 -0
- package/dist/cli/Realms.js +48 -0
- package/dist/cli/Realms.js.map +1 -0
- package/dist/cli/Session.d.ts +79 -0
- package/dist/cli/Session.d.ts.map +1 -0
- package/dist/cli/Session.js +229 -0
- package/dist/cli/Session.js.map +1 -0
- package/dist/cli/User.d.ts +24 -0
- package/dist/cli/User.d.ts.map +1 -0
- package/dist/cli/User.js +34 -0
- package/dist/cli/User.js.map +1 -0
- package/dist/cli/V1.d.ts +32 -0
- package/dist/cli/V1.d.ts.map +1 -0
- package/dist/cli/V1.js +38 -0
- package/dist/cli/V1.js.map +1 -0
- package/dist/cli/bin.d.ts +3 -0
- package/dist/cli/bin.d.ts.map +1 -0
- package/dist/cli/bin.js +46 -0
- package/dist/cli/bin.js.map +1 -0
- package/dist/cli/commands/admin/apps/create.d.ts +23 -0
- package/dist/cli/commands/admin/apps/create.d.ts.map +1 -0
- package/dist/cli/commands/admin/apps/create.js +84 -0
- package/dist/cli/commands/admin/apps/create.js.map +1 -0
- package/dist/cli/commands/admin/apps/delete.d.ts +15 -0
- package/dist/cli/commands/admin/apps/delete.d.ts.map +1 -0
- package/dist/cli/commands/admin/apps/delete.js +41 -0
- package/dist/cli/commands/admin/apps/delete.js.map +1 -0
- package/dist/cli/commands/admin/apps/index.d.ts +5 -0
- package/dist/cli/commands/admin/apps/index.d.ts.map +1 -0
- package/dist/cli/commands/admin/apps/index.js +14 -0
- package/dist/cli/commands/admin/apps/index.js.map +1 -0
- package/dist/cli/commands/admin/apps/list.d.ts +10 -0
- package/dist/cli/commands/admin/apps/list.d.ts.map +1 -0
- package/dist/cli/commands/admin/apps/list.js +26 -0
- package/dist/cli/commands/admin/apps/list.js.map +1 -0
- package/dist/cli/commands/admin/apps/rotate-secret.d.ts +17 -0
- package/dist/cli/commands/admin/apps/rotate-secret.d.ts.map +1 -0
- package/dist/cli/commands/admin/apps/rotate-secret.js +47 -0
- package/dist/cli/commands/admin/apps/rotate-secret.js.map +1 -0
- package/dist/cli/commands/admin/apps/update.d.ts +20 -0
- package/dist/cli/commands/admin/apps/update.d.ts.map +1 -0
- package/dist/cli/commands/admin/apps/update.js +71 -0
- package/dist/cli/commands/admin/apps/update.js.map +1 -0
- package/dist/cli/commands/admin/index.d.ts +5 -0
- package/dist/cli/commands/admin/index.d.ts.map +1 -0
- package/dist/cli/commands/admin/index.js +13 -0
- package/dist/cli/commands/admin/index.js.map +1 -0
- package/dist/cli/commands/admin/migrate.d.ts +10 -0
- package/dist/cli/commands/admin/migrate.d.ts.map +1 -0
- package/dist/cli/commands/admin/migrate.js +20 -0
- package/dist/cli/commands/admin/migrate.js.map +1 -0
- package/dist/cli/commands/admin/realms/add.d.ts +13 -0
- package/dist/cli/commands/admin/realms/add.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/add.js +42 -0
- package/dist/cli/commands/admin/realms/add.js.map +1 -0
- package/dist/cli/commands/admin/realms/index.d.ts +5 -0
- package/dist/cli/commands/admin/realms/index.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/index.js +13 -0
- package/dist/cli/commands/admin/realms/index.js.map +1 -0
- package/dist/cli/commands/admin/realms/list.d.ts +14 -0
- package/dist/cli/commands/admin/realms/list.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/list.js +36 -0
- package/dist/cli/commands/admin/realms/list.js.map +1 -0
- package/dist/cli/commands/admin/realms/passkeys/index.d.ts +5 -0
- package/dist/cli/commands/admin/realms/passkeys/index.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/passkeys/index.js +13 -0
- package/dist/cli/commands/admin/realms/passkeys/index.js.map +1 -0
- package/dist/cli/commands/admin/realms/passkeys/set.d.ts +17 -0
- package/dist/cli/commands/admin/realms/passkeys/set.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/passkeys/set.js +46 -0
- package/dist/cli/commands/admin/realms/passkeys/set.js.map +1 -0
- package/dist/cli/commands/admin/realms/privy/index.d.ts +5 -0
- package/dist/cli/commands/admin/realms/privy/index.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/privy/index.js +13 -0
- package/dist/cli/commands/admin/realms/privy/index.js.map +1 -0
- package/dist/cli/commands/admin/realms/privy/set.d.ts +19 -0
- package/dist/cli/commands/admin/realms/privy/set.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/privy/set.js +66 -0
- package/dist/cli/commands/admin/realms/privy/set.js.map +1 -0
- package/dist/cli/commands/admin/realms/remove.d.ts +12 -0
- package/dist/cli/commands/admin/realms/remove.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/remove.js +35 -0
- package/dist/cli/commands/admin/realms/remove.js.map +1 -0
- package/dist/cli/commands/admin/realms/secp256k1/disable.d.ts +16 -0
- package/dist/cli/commands/admin/realms/secp256k1/disable.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/secp256k1/disable.js +42 -0
- package/dist/cli/commands/admin/realms/secp256k1/disable.js.map +1 -0
- package/dist/cli/commands/admin/realms/secp256k1/enable.d.ts +16 -0
- package/dist/cli/commands/admin/realms/secp256k1/enable.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/secp256k1/enable.js +42 -0
- package/dist/cli/commands/admin/realms/secp256k1/enable.js.map +1 -0
- package/dist/cli/commands/admin/realms/secp256k1/index.d.ts +9 -0
- package/dist/cli/commands/admin/realms/secp256k1/index.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/secp256k1/index.js +17 -0
- package/dist/cli/commands/admin/realms/secp256k1/index.js.map +1 -0
- package/dist/cli/commands/admin/realms/set.d.ts +17 -0
- package/dist/cli/commands/admin/realms/set.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/set.js +46 -0
- package/dist/cli/commands/admin/realms/set.js.map +1 -0
- package/dist/cli/commands/admin/rotate-key.d.ts +16 -0
- package/dist/cli/commands/admin/rotate-key.d.ts.map +1 -0
- package/dist/cli/commands/admin/rotate-key.js +46 -0
- package/dist/cli/commands/admin/rotate-key.js.map +1 -0
- package/dist/cli/commands/init.d.ts +11 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +34 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/login.d.ts +12 -0
- package/dist/cli/commands/login.d.ts.map +1 -0
- package/dist/cli/commands/login.js +29 -0
- package/dist/cli/commands/login.js.map +1 -0
- package/dist/cli/commands/logout.d.ts +8 -0
- package/dist/cli/commands/logout.d.ts.map +1 -0
- package/dist/cli/commands/logout.js +19 -0
- package/dist/cli/commands/logout.js.map +1 -0
- package/dist/cli/commands/whoami.d.ts +12 -0
- package/dist/cli/commands/whoami.d.ts.map +1 -0
- package/dist/cli/commands/whoami.js +24 -0
- package/dist/cli/commands/whoami.js.map +1 -0
- package/dist/client/Actions.d.ts +108 -0
- package/dist/client/Actions.d.ts.map +1 -0
- package/dist/client/Actions.js +94 -0
- package/dist/client/Actions.js.map +1 -0
- package/dist/client/Auth.d.ts +143 -0
- package/dist/client/Auth.d.ts.map +1 -0
- package/dist/client/Auth.js +106 -0
- package/dist/client/Auth.js.map +1 -0
- package/dist/client/Authorization.d.ts +29 -0
- package/dist/client/Authorization.d.ts.map +1 -0
- package/dist/client/Authorization.js +12 -0
- package/dist/client/Authorization.js.map +1 -0
- package/dist/client/Decorator.d.ts +172 -0
- package/dist/client/Decorator.d.ts.map +1 -0
- package/dist/client/Decorator.js +241 -0
- package/dist/client/Decorator.js.map +1 -0
- package/dist/client/Key.d.ts +82 -0
- package/dist/client/Key.d.ts.map +1 -0
- package/dist/client/Key.js +81 -0
- package/dist/client/Key.js.map +1 -0
- package/dist/client/Pending.d.ts +38 -0
- package/dist/client/Pending.d.ts.map +1 -0
- package/dist/client/Pending.js +12 -0
- package/dist/client/Pending.js.map +1 -0
- package/dist/client/Permissions.d.ts +36 -0
- package/dist/client/Permissions.d.ts.map +1 -0
- package/dist/client/Permissions.js +16 -0
- package/dist/client/Permissions.js.map +1 -0
- package/dist/client/Storage.d.ts +27 -0
- package/dist/client/Storage.d.ts.map +1 -0
- package/dist/client/Storage.js +16 -0
- package/dist/client/Storage.js.map +1 -0
- package/dist/client/TempoAccount.d.ts +52 -0
- package/dist/client/TempoAccount.d.ts.map +1 -0
- package/dist/client/TempoAccount.js +17 -0
- package/dist/client/TempoAccount.js.map +1 -0
- package/dist/client/Tokens.d.ts +25 -0
- package/dist/client/Tokens.d.ts.map +1 -0
- package/dist/client/Tokens.js +12 -0
- package/dist/client/Tokens.js.map +1 -0
- package/dist/client/User.d.ts +21 -0
- package/dist/client/User.d.ts.map +1 -0
- package/dist/client/User.js +12 -0
- package/dist/client/User.js.map +1 -0
- package/dist/client/actions/account.d.ts +75 -0
- package/dist/client/actions/account.d.ts.map +1 -0
- package/dist/client/actions/account.js +102 -0
- package/dist/client/actions/account.js.map +1 -0
- package/dist/client/actions/device.d.ts +52 -0
- package/dist/client/actions/device.d.ts.map +1 -0
- package/dist/client/actions/device.js +103 -0
- package/dist/client/actions/device.js.map +1 -0
- package/dist/client/actions/email.d.ts +89 -0
- package/dist/client/actions/email.d.ts.map +1 -0
- package/dist/client/actions/email.js +86 -0
- package/dist/client/actions/email.js.map +1 -0
- package/dist/client/actions/oauth.d.ts +112 -0
- package/dist/client/actions/oauth.d.ts.map +1 -0
- package/dist/client/actions/oauth.js +103 -0
- package/dist/client/actions/oauth.js.map +1 -0
- package/dist/client/actions/passkey.d.ts +140 -0
- package/dist/client/actions/passkey.d.ts.map +1 -0
- package/dist/client/actions/passkey.js +170 -0
- package/dist/client/actions/passkey.js.map +1 -0
- package/dist/client/actions/realm.d.ts +25 -0
- package/dist/client/actions/realm.d.ts.map +1 -0
- package/dist/client/actions/realm.js +16 -0
- package/dist/client/actions/realm.js.map +1 -0
- package/dist/client/actions/redirect.d.ts +152 -0
- package/dist/client/actions/redirect.d.ts.map +1 -0
- package/dist/client/actions/redirect.js +311 -0
- package/dist/client/actions/redirect.js.map +1 -0
- package/dist/client/internal/accessKey.d.ts +21 -0
- package/dist/client/internal/accessKey.d.ts.map +1 -0
- package/dist/client/internal/accessKey.js +38 -0
- package/dist/client/internal/accessKey.js.map +1 -0
- package/dist/client/internal/account.d.ts +17 -0
- package/dist/client/internal/account.d.ts.map +1 -0
- package/dist/client/internal/account.js +3 -0
- package/dist/client/internal/account.js.map +1 -0
- package/dist/client/internal/api.d.ts +110 -0
- package/dist/client/internal/api.d.ts.map +1 -0
- package/dist/client/internal/api.js +136 -0
- package/dist/client/internal/api.js.map +1 -0
- package/dist/client/internal/headless.d.ts +159 -0
- package/dist/client/internal/headless.d.ts.map +1 -0
- package/dist/client/internal/headless.js +196 -0
- package/dist/client/internal/headless.js.map +1 -0
- package/dist/client/internal/indexedDb.d.ts +8 -0
- package/dist/client/internal/indexedDb.d.ts.map +1 -0
- package/dist/client/internal/indexedDb.js +32 -0
- package/dist/client/internal/indexedDb.js.map +1 -0
- package/dist/client/internal/request.d.ts +56 -0
- package/dist/client/internal/request.d.ts.map +1 -0
- package/dist/client/internal/request.js +44 -0
- package/dist/client/internal/request.js.map +1 -0
- package/dist/client/internal/store.d.ts +12 -0
- package/dist/client/internal/store.d.ts.map +1 -0
- package/dist/client/internal/store.js +15 -0
- package/dist/client/internal/store.js.map +1 -0
- package/dist/client/internal/verifier.d.ts +25 -0
- package/dist/client/internal/verifier.d.ts.map +1 -0
- package/dist/client/internal/verifier.js +52 -0
- package/dist/client/internal/verifier.js.map +1 -0
- package/dist/client.d.ts +18 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +18 -0
- package/dist/client.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/Apps.d.ts +3169 -0
- package/dist/internal/Apps.d.ts.map +1 -0
- package/dist/internal/Apps.js +948 -0
- package/dist/internal/Apps.js.map +1 -0
- package/dist/internal/Auth.d.ts +4287 -0
- package/dist/internal/Auth.d.ts.map +1 -0
- package/dist/internal/Auth.js +185 -0
- package/dist/internal/Auth.js.map +1 -0
- package/dist/internal/Authorize.d.ts +526 -0
- package/dist/internal/Authorize.d.ts.map +1 -0
- package/dist/internal/Authorize.js +330 -0
- package/dist/internal/Authorize.js.map +1 -0
- package/dist/internal/Cache.d.ts +56 -0
- package/dist/internal/Cache.d.ts.map +1 -0
- package/dist/internal/Cache.js +65 -0
- package/dist/internal/Cache.js.map +1 -0
- package/dist/internal/Chain.d.ts +738 -0
- package/dist/internal/Chain.d.ts.map +1 -0
- package/dist/internal/Chain.js +65 -0
- package/dist/internal/Chain.js.map +1 -0
- package/dist/internal/ChainList.d.ts +117 -0
- package/dist/internal/ChainList.d.ts.map +1 -0
- package/dist/internal/ChainList.js +148 -0
- package/dist/internal/ChainList.js.map +1 -0
- package/dist/internal/ChainName.d.ts +11 -0
- package/dist/internal/ChainName.d.ts.map +1 -0
- package/dist/internal/ChainName.js +13 -0
- package/dist/internal/ChainName.js.map +1 -0
- package/dist/internal/CodeEmail.d.ts +38 -0
- package/dist/internal/CodeEmail.d.ts.map +1 -0
- package/dist/internal/CodeEmail.js +85 -0
- package/dist/internal/CodeEmail.js.map +1 -0
- package/dist/internal/ConfigurableAccount.d.ts +600 -0
- package/dist/internal/ConfigurableAccount.d.ts.map +1 -0
- package/dist/internal/ConfigurableAccount.js +795 -0
- package/dist/internal/ConfigurableAccount.js.map +1 -0
- package/dist/internal/Device.d.ts +246 -0
- package/dist/internal/Device.d.ts.map +1 -0
- package/dist/internal/Device.js +257 -0
- package/dist/internal/Device.js.map +1 -0
- package/dist/internal/Env.d.ts +97 -0
- package/dist/internal/Env.d.ts.map +1 -0
- package/dist/internal/Env.js +2 -0
- package/dist/internal/Env.js.map +1 -0
- package/dist/internal/ErrorResponse.d.ts +608 -0
- package/dist/internal/ErrorResponse.d.ts.map +1 -0
- package/dist/internal/ErrorResponse.js +701 -0
- package/dist/internal/ErrorResponse.js.map +1 -0
- package/dist/internal/Id.d.ts +10 -0
- package/dist/internal/Id.d.ts.map +1 -0
- package/dist/internal/Id.js +34 -0
- package/dist/internal/Id.js.map +1 -0
- package/dist/internal/KeyAuthorization.d.ts +1650 -0
- package/dist/internal/KeyAuthorization.d.ts.map +1 -0
- package/dist/internal/KeyAuthorization.js +1187 -0
- package/dist/internal/KeyAuthorization.js.map +1 -0
- package/dist/internal/Limits.d.ts +70 -0
- package/dist/internal/Limits.d.ts.map +1 -0
- package/dist/internal/Limits.js +36 -0
- package/dist/internal/Limits.js.map +1 -0
- package/dist/internal/Log.d.ts +34 -0
- package/dist/internal/Log.d.ts.map +1 -0
- package/dist/internal/Log.js +99 -0
- package/dist/internal/Log.js.map +1 -0
- package/dist/internal/LogLine.d.ts +29 -0
- package/dist/internal/LogLine.d.ts.map +1 -0
- package/dist/internal/LogLine.js +50 -0
- package/dist/internal/LogLine.js.map +1 -0
- package/dist/internal/Migrations.d.ts +28 -0
- package/dist/internal/Migrations.d.ts.map +1 -0
- package/dist/internal/Migrations.js +82 -0
- package/dist/internal/Migrations.js.map +1 -0
- package/dist/internal/Owner.d.ts +230 -0
- package/dist/internal/Owner.d.ts.map +1 -0
- package/dist/internal/Owner.js +101 -0
- package/dist/internal/Owner.js.map +1 -0
- package/dist/internal/Passkey.d.ts +901 -0
- package/dist/internal/Passkey.d.ts.map +1 -0
- package/dist/internal/Passkey.js +1185 -0
- package/dist/internal/Passkey.js.map +1 -0
- package/dist/internal/PendingKey.d.ts +49 -0
- package/dist/internal/PendingKey.d.ts.map +1 -0
- package/dist/internal/PendingKey.js +58 -0
- package/dist/internal/PendingKey.js.map +1 -0
- package/dist/internal/Privy.d.ts +138 -0
- package/dist/internal/Privy.d.ts.map +1 -0
- package/dist/internal/Privy.js +285 -0
- package/dist/internal/Privy.js.map +1 -0
- package/dist/internal/RateLimit.d.ts +218 -0
- package/dist/internal/RateLimit.d.ts.map +1 -0
- package/dist/internal/RateLimit.js +209 -0
- package/dist/internal/RateLimit.js.map +1 -0
- package/dist/internal/Realm.d.ts +290 -0
- package/dist/internal/Realm.d.ts.map +1 -0
- package/dist/internal/Realm.js +502 -0
- package/dist/internal/Realm.js.map +1 -0
- package/dist/internal/RequestId.d.ts +16 -0
- package/dist/internal/RequestId.d.ts.map +1 -0
- package/dist/internal/RequestId.js +78 -0
- package/dist/internal/RequestId.js.map +1 -0
- package/dist/internal/SigningKey.d.ts +126 -0
- package/dist/internal/SigningKey.d.ts.map +1 -0
- package/dist/internal/SigningKey.js +221 -0
- package/dist/internal/SigningKey.js.map +1 -0
- package/dist/internal/TempoAccount.d.ts +181 -0
- package/dist/internal/TempoAccount.d.ts.map +1 -0
- package/dist/internal/TempoAccount.js +369 -0
- package/dist/internal/TempoAccount.js.map +1 -0
- package/dist/internal/TestInbox.d.ts +42 -0
- package/dist/internal/TestInbox.d.ts.map +1 -0
- package/dist/internal/TestInbox.js +20 -0
- package/dist/internal/TestInbox.js.map +1 -0
- package/dist/internal/Timing.d.ts +52 -0
- package/dist/internal/Timing.d.ts.map +1 -0
- package/dist/internal/Timing.js +116 -0
- package/dist/internal/Timing.js.map +1 -0
- package/dist/internal/Validation.d.ts +52 -0
- package/dist/internal/Validation.d.ts.map +1 -0
- package/dist/internal/Validation.js +22 -0
- package/dist/internal/Validation.js.map +1 -0
- package/dist/internal/Verification.d.ts +24 -0
- package/dist/internal/Verification.d.ts.map +1 -0
- package/dist/internal/Verification.js +37 -0
- package/dist/internal/Verification.js.map +1 -0
- package/dist/internal/Wallet.d.ts +66 -0
- package/dist/internal/Wallet.d.ts.map +1 -0
- package/dist/internal/Wallet.js +59 -0
- package/dist/internal/Wallet.js.map +1 -0
- package/dist/internal/owners/Passkey.d.ts +9 -0
- package/dist/internal/owners/Passkey.d.ts.map +1 -0
- package/dist/internal/owners/Passkey.js +58 -0
- package/dist/internal/owners/Passkey.js.map +1 -0
- package/dist/internal/owners/Privy.d.ts +13 -0
- package/dist/internal/owners/Privy.d.ts.map +1 -0
- package/dist/internal/owners/Privy.js +59 -0
- package/dist/internal/owners/Privy.js.map +1 -0
- package/dist/internal/owners/Secp256k1.d.ts +12 -0
- package/dist/internal/owners/Secp256k1.d.ts.map +1 -0
- package/dist/internal/owners/Secp256k1.js +99 -0
- package/dist/internal/owners/Secp256k1.js.map +1 -0
- package/dist/worker.d.ts +18 -0
- package/dist/worker.d.ts.map +1 -0
- package/dist/worker.js +18 -0
- package/dist/worker.js.map +1 -0
- package/package.json +83 -3
- package/src/Api.ts +157 -0
- package/src/App.ts +316 -0
- package/src/api/account.ts +2266 -0
- package/src/api/authenticate.ts +1662 -0
- package/src/api/authorize.ts +1086 -0
- package/src/api/device.ts +516 -0
- package/src/api/health.ts +72 -0
- package/src/api/lib/AccountStep.ts +485 -0
- package/src/api/lib/Auth.ts +164 -0
- package/src/api/lib/Configure.ts +921 -0
- package/src/api/lib/Consent.ts +388 -0
- package/src/api/lib/Cors.ts +160 -0
- package/src/api/lib/Database.ts +10 -0
- package/src/api/lib/DeviceRequest.ts +244 -0
- package/src/api/lib/FirstAccount.ts +136 -0
- package/src/api/lib/Headless.ts +616 -0
- package/src/api/lib/IsolateCache.ts +28 -0
- package/src/api/lib/KeySigner.ts +690 -0
- package/src/api/lib/PasskeyLink.ts +162 -0
- package/src/api/lib/Session.ts +64 -0
- package/src/api/lib/SignInConsent.ts +393 -0
- package/src/api/oauth.ts +1796 -0
- package/src/app/components/CodeInput.tsx +153 -0
- package/src/app/components/DevTools.tsx +1071 -0
- package/src/app/components/Grant.tsx +476 -0
- package/src/app/components/icons/BRLA.png +0 -0
- package/src/app/components/icons/BRZ.svg +1 -0
- package/src/app/components/icons/CHFAU.png +0 -0
- package/src/app/components/icons/DLUSD.png +0 -0
- package/src/app/components/icons/EURAU.svg +1 -0
- package/src/app/components/icons/EURC.e.svg +1 -0
- package/src/app/components/icons/GBPA.svg +4 -0
- package/src/app/components/icons/GUSD.svg +1 -0
- package/src/app/components/icons/MACH.svg +4 -0
- package/src/app/components/icons/OUSD.svg +5 -0
- package/src/app/components/icons/PRIME.svg +14 -0
- package/src/app/components/icons/SBC.svg +1 -0
- package/src/app/components/icons/SEKAU.svg +5 -0
- package/src/app/components/icons/USD1.svg +30 -0
- package/src/app/components/icons/USDB.svg +11 -0
- package/src/app/components/icons/USDC.e.svg +1 -0
- package/src/app/components/icons/USDT0.svg +1 -0
- package/src/app/components/icons/USDY.svg +16 -0
- package/src/app/components/icons/USDe.svg +1 -0
- package/src/app/components/icons/YLDS.svg +3 -0
- package/src/app/components/icons/alphaUSD.svg +1 -0
- package/src/app/components/icons/betaUSD.svg +1 -0
- package/src/app/components/icons/cUSD.svg +1 -0
- package/src/app/components/icons/cbBTC.svg +1 -0
- package/src/app/components/icons/frxUSD.svg +1 -0
- package/src/app/components/icons/goUSD.svg +5 -0
- package/src/app/components/icons/iUSD.svg +1 -0
- package/src/app/components/icons/pathUSD.svg +25 -0
- package/src/app/components/icons/rUSD.svg +1 -0
- package/src/app/components/icons/reUSD.svg +1 -0
- package/src/app/components/icons/sUSDe.svg +1 -0
- package/src/app/components/icons/siUSD.svg +1 -0
- package/src/app/components/icons/stcUSD.svg +1 -0
- package/src/app/components/icons/syrupUSDC.svg +5 -0
- package/src/app/components/icons/thetaUSD.svg +1 -0
- package/src/app/components/icons/wYLDS.svg +10 -0
- package/src/app/components/icons/wsrUSD.svg +1 -0
- package/src/app/components/logos/OUSD.dark.svg +17 -0
- package/src/app/components/logos/OUSD.light.svg +17 -0
- package/src/app/coverage.server.ts +73 -0
- package/src/app/coverage.ts +69 -0
- package/src/app/crons/cleanup.ts +104 -0
- package/src/app/db/auth.ts +440 -0
- package/src/app/db/migrations/0000_better_auth.sql +53 -0
- package/src/app/db/migrations/0001_oauth_provider.sql +162 -0
- package/src/app/db/migrations/0002_device_code.sql +17 -0
- package/src/app/db/migrations/0003_realms.sql +27 -0
- package/src/app/db/migrations/0004_default_realm.sql +2 -0
- package/src/app/db/migrations/0005_passkeys.sql +30 -0
- package/src/app/db/migrations/0006_first_accounts.sql +9 -0
- package/src/app/db/migrations/0007_pending_keys.sql +13 -0
- package/src/app/db/migrations/0008_secp256k1_owners.sql +18 -0
- package/src/app/db/migrations/0009_device_requests.sql +8 -0
- package/src/app/db/migrations/0010_device_keys.sql +4 -0
- package/src/app/db/migrations/0011_registered_passkeys.sql +2 -0
- package/src/app/db/migrations/0012_passkey_accounts.sql +7 -0
- package/src/app/db/migrations/0013_first_party_apps.sql +4 -0
- package/src/app/db/migrations/0014_logout_revokes_tokens.sql +17 -0
- package/src/app/db/migrations/0015_expiry_indexes.sql +9 -0
- package/src/app/db/migrations/0016_configurable_accounts.sql +15 -0
- package/src/app/db/migrations/0017_account_config_keys.sql +3 -0
- package/src/app/db/migrations/0018_better_auth_1_8.sql +9 -0
- package/src/app/db/migrations/0019_drop_provider_account_index.sql +1 -0
- package/src/app/db/migrations/meta/0000_snapshot.json +362 -0
- package/src/app/db/migrations/meta/0001_snapshot.json +1487 -0
- package/src/app/db/migrations/meta/0002_snapshot.json +1603 -0
- package/src/app/db/migrations/meta/0003_snapshot.json +1760 -0
- package/src/app/db/migrations/meta/0004_snapshot.json +1760 -0
- package/src/app/db/migrations/meta/0005_snapshot.json +1911 -0
- package/src/app/db/migrations/meta/0006_snapshot.json +1967 -0
- package/src/app/db/migrations/meta/0007_snapshot.json +2047 -0
- package/src/app/db/migrations/meta/0008_snapshot.json +2157 -0
- package/src/app/db/migrations/meta/0009_snapshot.json +2207 -0
- package/src/app/db/migrations/meta/0010_snapshot.json +2231 -0
- package/src/app/db/migrations/meta/0011_snapshot.json +2231 -0
- package/src/app/db/migrations/meta/0012_snapshot.json +2231 -0
- package/src/app/db/migrations/meta/0013_snapshot.json +2231 -0
- package/src/app/db/migrations/meta/0014_snapshot.json +2231 -0
- package/src/app/db/migrations/meta/0015_snapshot.json +2375 -0
- package/src/app/db/migrations/meta/0016_snapshot.json +2475 -0
- package/src/app/db/migrations/meta/0017_snapshot.json +2481 -0
- package/src/app/db/migrations/meta/0018_snapshot.json +2535 -0
- package/src/app/db/migrations/meta/0019_snapshot.json +2514 -0
- package/src/app/db/migrations/meta/_journal.json +146 -0
- package/src/app/db/schema.ts +241 -0
- package/src/app/db/table.ts +31 -0
- package/src/app/env.ts +57 -0
- package/src/app/inbox.ts +190 -0
- package/src/app/lib/Client.ts +82 -0
- package/src/app/lib/Inbox.ts +11 -0
- package/src/app/lib/Loader.ts +21 -0
- package/src/app/lib/Upgrade.ts +221 -0
- package/src/app/package.json +8 -0
- package/src/app/public/_headers +4 -0
- package/src/app/routeTree.gen.ts +219 -0
- package/src/app/router.tsx +47 -0
- package/src/app/routes/[_].flows.tsx +4254 -0
- package/src/app/routes/__root.tsx +172 -0
- package/src/app/routes/authorize.tsx +379 -0
- package/src/app/routes/choose-account.tsx +144 -0
- package/src/app/routes/deposit.tsx +107 -0
- package/src/app/routes/device.tsx +273 -0
- package/src/app/routes/error.tsx +62 -0
- package/src/app/routes/index.tsx +511 -0
- package/src/app/routes/login.tsx +577 -0
- package/src/app/screens/Account.tsx +559 -0
- package/src/app/screens/Approval.tsx +444 -0
- package/src/app/screens/ChooseAccount.tsx +206 -0
- package/src/app/screens/Deposit.tsx +523 -0
- package/src/app/screens/DeviceApproval.tsx +500 -0
- package/src/app/screens/NotFound.tsx +62 -0
- package/src/app/screens/SignIn.tsx +372 -0
- package/src/app/screens/WalletUpgrade.tsx +121 -0
- package/src/app/screens/chains/base.svg +3 -0
- package/src/app/screens/chains/ethereum.svg +11 -0
- package/src/app/screens/chains/solana.svg +4 -0
- package/src/app/screens/chains/tempo.svg +4 -0
- package/src/app/server.ts +342 -0
- package/src/app/vite.config.ts +128 -0
- package/src/app/void.config.ts +36 -0
- package/src/app/wallet.ts +69 -0
- package/src/app/zyzz.config.ts +52 -0
- package/src/cli/Admin.ts +74 -0
- package/src/cli/Apps.ts +27 -0
- package/src/cli/Cli.ts +41 -0
- package/src/cli/Project.ts +119 -0
- package/src/cli/Realms.ts +49 -0
- package/src/cli/Session.ts +290 -0
- package/src/cli/User.ts +40 -0
- package/src/cli/V1.ts +54 -0
- package/src/cli/bin.ts +44 -0
- package/src/cli/commands/admin/apps/create.ts +96 -0
- package/src/cli/commands/admin/apps/delete.ts +38 -0
- package/src/cli/commands/admin/apps/index.ts +15 -0
- package/src/cli/commands/admin/apps/list.ts +25 -0
- package/src/cli/commands/admin/apps/rotate-secret.ts +47 -0
- package/src/cli/commands/admin/apps/update.ts +79 -0
- package/src/cli/commands/admin/index.ts +14 -0
- package/src/cli/commands/admin/migrate.ts +19 -0
- package/src/cli/commands/admin/realms/add.ts +40 -0
- package/src/cli/commands/admin/realms/index.ts +14 -0
- package/src/cli/commands/admin/realms/list.ts +38 -0
- package/src/cli/commands/admin/realms/passkeys/index.ts +15 -0
- package/src/cli/commands/admin/realms/passkeys/set.ts +44 -0
- package/src/cli/commands/admin/realms/privy/index.ts +14 -0
- package/src/cli/commands/admin/realms/privy/set.ts +69 -0
- package/src/cli/commands/admin/realms/remove.ts +33 -0
- package/src/cli/commands/admin/realms/secp256k1/disable.ts +40 -0
- package/src/cli/commands/admin/realms/secp256k1/enable.ts +40 -0
- package/src/cli/commands/admin/realms/secp256k1/index.ts +19 -0
- package/src/cli/commands/admin/realms/set.ts +46 -0
- package/src/cli/commands/admin/rotate-key.ts +47 -0
- package/src/cli/commands/init.ts +42 -0
- package/src/cli/commands/login.ts +32 -0
- package/src/cli/commands/logout.ts +19 -0
- package/src/cli/commands/whoami.ts +23 -0
- package/src/client/Actions.ts +180 -0
- package/src/client/Auth.ts +267 -0
- package/src/client/Authorization.ts +34 -0
- package/src/client/Decorator.ts +444 -0
- package/src/client/Key.ts +137 -0
- package/src/client/Pending.ts +45 -0
- package/src/client/Permissions.ts +41 -0
- package/src/client/Storage.ts +29 -0
- package/src/client/TempoAccount.ts +55 -0
- package/src/client/Tokens.ts +27 -0
- package/src/client/User.ts +23 -0
- package/src/client/actions/account.ts +171 -0
- package/src/client/actions/device.ts +166 -0
- package/src/client/actions/email.ts +164 -0
- package/src/client/actions/oauth.ts +179 -0
- package/src/client/actions/passkey.ts +333 -0
- package/src/client/actions/realm.ts +37 -0
- package/src/client/actions/redirect.ts +502 -0
- package/src/client/internal/accessKey.ts +54 -0
- package/src/client/internal/account.ts +18 -0
- package/src/client/internal/api.ts +242 -0
- package/src/client/internal/headless.ts +308 -0
- package/src/client/internal/indexedDb.ts +44 -0
- package/src/client/internal/request.ts +70 -0
- package/src/client/internal/store.ts +20 -0
- package/src/client/internal/verifier.ts +75 -0
- package/src/client.ts +17 -0
- package/src/index.ts +5 -0
- package/src/internal/Apps.ts +1283 -0
- package/src/internal/Auth.ts +273 -0
- package/src/internal/Authorize.ts +433 -0
- package/src/internal/Balance.ts +144 -0
- package/src/internal/BodyLimit.ts +31 -0
- package/src/internal/Cache.ts +119 -0
- package/src/internal/Chain.ts +99 -0
- package/src/internal/ChainList.ts +270 -0
- package/src/internal/ChainName.ts +14 -0
- package/src/internal/ChainStatus.ts +65 -0
- package/src/internal/CodeEmail.ts +138 -0
- package/src/internal/ConfigurableAccount.ts +1315 -0
- package/src/internal/Device.ts +471 -0
- package/src/internal/Env.ts +92 -0
- package/src/internal/ErrorResponse.ts +896 -0
- package/src/internal/Faucet.ts +43 -0
- package/src/internal/Id.ts +41 -0
- package/src/internal/KeyAuthorization.ts +1536 -0
- package/src/internal/Limits.ts +40 -0
- package/src/internal/Log.ts +166 -0
- package/src/internal/LogLine.ts +81 -0
- package/src/internal/Logout.ts +356 -0
- package/src/internal/Migrations.ts +120 -0
- package/src/internal/OpenApi.ts +300 -0
- package/src/internal/Owner.ts +310 -0
- package/src/internal/Passkey.ts +1904 -0
- package/src/internal/PendingKey.ts +104 -0
- package/src/internal/Privy.ts +536 -0
- package/src/internal/RateLimit.ts +346 -0
- package/src/internal/Realm.ts +814 -0
- package/src/internal/RequestId.ts +118 -0
- package/src/internal/SignInGrant.ts +175 -0
- package/src/internal/SigningKey.ts +319 -0
- package/src/internal/TempoAccount.ts +545 -0
- package/src/internal/TestInbox.ts +51 -0
- package/src/internal/Timing.ts +172 -0
- package/src/internal/Validation.ts +52 -0
- package/src/internal/Verification.ts +58 -0
- package/src/internal/Wallet.ts +101 -0
- package/src/internal/owners/Passkey.ts +76 -0
- package/src/internal/owners/Privy.ts +82 -0
- package/src/internal/owners/Secp256k1.ts +139 -0
- package/src/types/app.d.ts +39 -0
- package/src/worker.ts +17 -0
|
@@ -0,0 +1,1086 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Authorizations under `/v1/authorize`: an app's headless authorization, with the key authorization
|
|
3
|
+
* that the account's owner signs, and the requests of the pages that an app's authorization passes
|
|
4
|
+
* through, the account step's selection and the approval page's decision. Better Auth issues every
|
|
5
|
+
* code and token, in process.
|
|
6
|
+
* @module
|
|
7
|
+
*/
|
|
8
|
+
import { verifyOAuthQueryParams } from '@better-auth/oauth-provider'
|
|
9
|
+
import { isAPIError } from 'better-auth/api'
|
|
10
|
+
import type { Context } from 'hono'
|
|
11
|
+
import { Hono } from 'hono'
|
|
12
|
+
import { env } from 'void/env'
|
|
13
|
+
import * as z from 'zod'
|
|
14
|
+
import * as Apps from '../internal/Apps.js'
|
|
15
|
+
import * as core_Auth from '../internal/Auth.js'
|
|
16
|
+
import * as Authorize from '../internal/Authorize.js'
|
|
17
|
+
import * as Balance from '../internal/Balance.js'
|
|
18
|
+
import * as BodyLimit from '../internal/BodyLimit.js'
|
|
19
|
+
import * as Cache from '../internal/Cache.js'
|
|
20
|
+
import * as Chain from '../internal/Chain.js'
|
|
21
|
+
import type { Env } from '../internal/Env.js'
|
|
22
|
+
import * as ErrorResponse from '../internal/ErrorResponse.js'
|
|
23
|
+
import * as KeyAuthorization from '../internal/KeyAuthorization.js'
|
|
24
|
+
import * as OpenApi from '../internal/OpenApi.js'
|
|
25
|
+
import * as Passkey from '../internal/Passkey.js'
|
|
26
|
+
import * as RateLimit from '../internal/RateLimit.js'
|
|
27
|
+
import * as Realm from '../internal/Realm.js'
|
|
28
|
+
import * as TempoAccount from '../internal/TempoAccount.js'
|
|
29
|
+
import * as Timing from '../internal/Timing.js'
|
|
30
|
+
import * as Validation from '../internal/Validation.js'
|
|
31
|
+
import * as AccountStep from './lib/AccountStep.js'
|
|
32
|
+
import * as Consent from './lib/Consent.js'
|
|
33
|
+
import * as Cors from './lib/Cors.js'
|
|
34
|
+
import { db } from './lib/Database.js'
|
|
35
|
+
import * as Headless from './lib/Headless.js'
|
|
36
|
+
import * as KeySigner from './lib/KeySigner.js'
|
|
37
|
+
import * as Session from './lib/Session.js'
|
|
38
|
+
import * as SignInConsent from './lib/SignInConsent.js'
|
|
39
|
+
|
|
40
|
+
namespace schema {
|
|
41
|
+
export namespace authorize {
|
|
42
|
+
export const json = Authorize.schema.request.and(
|
|
43
|
+
z.object({
|
|
44
|
+
passkey: z
|
|
45
|
+
.union([
|
|
46
|
+
z.literal(true).meta({
|
|
47
|
+
description:
|
|
48
|
+
"Requests the passkey step for an account that a passkey owns, in place of `webauthn_required`. The passkey's relying party must cover the page's origin.",
|
|
49
|
+
}),
|
|
50
|
+
z.object({ assertion: Passkey.schema.assertion }).meta({
|
|
51
|
+
description:
|
|
52
|
+
"The passkey's assertion over the options of the passkey step. The repeated request signs the key with it.",
|
|
53
|
+
}),
|
|
54
|
+
])
|
|
55
|
+
.optional()
|
|
56
|
+
.meta({
|
|
57
|
+
description:
|
|
58
|
+
"Whether the app's page signs the key with the passkey that owns the account. Absent, a passkey-owned account refuses the key with `webauthn_required`.",
|
|
59
|
+
}),
|
|
60
|
+
}),
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
export const step = Passkey.schema.headlessStep
|
|
64
|
+
|
|
65
|
+
export const response = z.union([Authorize.schema.response, step])
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export namespace account {
|
|
69
|
+
export const json = z.object({
|
|
70
|
+
account: TempoAccount.schema.tempoAccount.shape.address.meta({
|
|
71
|
+
description:
|
|
72
|
+
"The address of the account that the user selects, one of the user's accounts in the app's realms.",
|
|
73
|
+
examples: ['0x8C3b5d0e2A4f6B1c9D7e3F5a0B2c4D6e8F1a3B5c'],
|
|
74
|
+
}),
|
|
75
|
+
oauth_query: z
|
|
76
|
+
.string()
|
|
77
|
+
.min(1)
|
|
78
|
+
.max(8192)
|
|
79
|
+
.meta({
|
|
80
|
+
description:
|
|
81
|
+
"The account step's query string, which Better Auth signs when it sends the browser there. At most 8,192 characters.",
|
|
82
|
+
examples: [
|
|
83
|
+
'client_id=Qk3vT9xZbLmN2pRw8YcHjF6sDaE4uGtK&response_type=code&exp=1760000000&sig=Gx3kB0',
|
|
84
|
+
],
|
|
85
|
+
}),
|
|
86
|
+
passkey: z
|
|
87
|
+
.object({ assertion: Passkey.schema.assertion })
|
|
88
|
+
.optional()
|
|
89
|
+
.meta({
|
|
90
|
+
description:
|
|
91
|
+
"The passkey's assertion over the options of the passkey step, which the selection of a passkey-owned account returns. The repeated selection signs the key with it.",
|
|
92
|
+
}),
|
|
93
|
+
})
|
|
94
|
+
|
|
95
|
+
export const response = z.union([
|
|
96
|
+
z
|
|
97
|
+
.object({
|
|
98
|
+
redirect: z.string().meta({
|
|
99
|
+
description:
|
|
100
|
+
"Where the browser continues: the approval page's path on Tempo ID, or the app's `redirect_uri` with an authorization code and `state`.",
|
|
101
|
+
examples: [
|
|
102
|
+
'https://app.example.com/callback?code=Vb7mQ2xLkP9sTzR4&state=af0ifjsldkj',
|
|
103
|
+
],
|
|
104
|
+
}),
|
|
105
|
+
})
|
|
106
|
+
.meta({ description: 'A selection that continues the authorization.' }),
|
|
107
|
+
Passkey.schema.step,
|
|
108
|
+
])
|
|
109
|
+
|
|
110
|
+
/** Better Auth's result, which names the redirect: a path on Tempo ID, or the app's URL. */
|
|
111
|
+
export const result = z.object({ url: z.string().min(1) })
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export namespace consent {
|
|
115
|
+
export const json = z.object({
|
|
116
|
+
accept: z.boolean().meta({
|
|
117
|
+
description:
|
|
118
|
+
'Whether the user approves the request. `false` denies it, and the app receives `access_denied`.',
|
|
119
|
+
examples: [true],
|
|
120
|
+
}),
|
|
121
|
+
account: TempoAccount.schema.tempoAccount.shape.address.optional().meta({
|
|
122
|
+
description:
|
|
123
|
+
"The Tempo Account that the approval page showed for the request's key authorization, one of the user's accounts in the app's realms. Ignored when the key names its account, and absent for a request without a key.",
|
|
124
|
+
examples: ['0x8C3b5d0e2A4f6B1c9D7e3F5a0B2c4D6e8F1a3B5c'],
|
|
125
|
+
}),
|
|
126
|
+
oauth_query: z
|
|
127
|
+
.string()
|
|
128
|
+
.min(1)
|
|
129
|
+
.max(8192)
|
|
130
|
+
.meta({
|
|
131
|
+
description:
|
|
132
|
+
"The approval page's query string, which Better Auth signs when it sends the browser there. At most 8,192 characters.",
|
|
133
|
+
examples: [
|
|
134
|
+
'client_id=Qk3vT9xZbLmN2pRw8YcHjF6sDaE4uGtK&response_type=code&exp=1760000000&sig=Gx3kB0',
|
|
135
|
+
],
|
|
136
|
+
}),
|
|
137
|
+
passkey: z
|
|
138
|
+
.object({ assertion: Passkey.schema.assertion })
|
|
139
|
+
.optional()
|
|
140
|
+
.meta({
|
|
141
|
+
description:
|
|
142
|
+
"The passkey's assertion over the options of the passkey step, which a passkey-owned account's approval returns. The repeated approval signs the key with it.",
|
|
143
|
+
}),
|
|
144
|
+
session_id: z
|
|
145
|
+
.string()
|
|
146
|
+
.min(1)
|
|
147
|
+
.max(256)
|
|
148
|
+
.meta({
|
|
149
|
+
description:
|
|
150
|
+
'The ID of the session that the approval page showed. The decision applies only while that session is the signed-in one.',
|
|
151
|
+
examples: ['8nVq3kZ0bT5wXy2mLp7sR4dA'],
|
|
152
|
+
}),
|
|
153
|
+
skip_upgrade: z
|
|
154
|
+
.boolean()
|
|
155
|
+
.optional()
|
|
156
|
+
.meta({
|
|
157
|
+
description:
|
|
158
|
+
"Whether the approval skips the pending upgrade of a wallet.tempo passkey's wallet on the key's chain, `false` by default. The passkey then signs the key as its own account, and the key stops working on that chain once the wallet upgrades, unless the chain registered it first.",
|
|
159
|
+
examples: [true],
|
|
160
|
+
}),
|
|
161
|
+
})
|
|
162
|
+
|
|
163
|
+
export const step = Passkey.schema.step
|
|
164
|
+
|
|
165
|
+
export const response = z.union([
|
|
166
|
+
z
|
|
167
|
+
.object({
|
|
168
|
+
redirect: z.url().meta({
|
|
169
|
+
description:
|
|
170
|
+
"The app's `redirect_uri`, with an authorization code and `state`, or with `error=access_denied` when the user denied the request.",
|
|
171
|
+
examples: [
|
|
172
|
+
'https://app.example.com/callback?code=Vb7mQ2xLkP9sTzR4&state=af0ifjsldkj',
|
|
173
|
+
],
|
|
174
|
+
}),
|
|
175
|
+
})
|
|
176
|
+
.meta({ description: 'A decision that returns to the app.' }),
|
|
177
|
+
step,
|
|
178
|
+
])
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export namespace request {
|
|
182
|
+
export const query = z.object({
|
|
183
|
+
oauth_query: z
|
|
184
|
+
.string()
|
|
185
|
+
.min(1)
|
|
186
|
+
.max(8192)
|
|
187
|
+
.meta({
|
|
188
|
+
description:
|
|
189
|
+
"The approval page's query string, which Better Auth signs when it sends the browser there. At most 8,192 characters.",
|
|
190
|
+
examples: [
|
|
191
|
+
'client_id=Qk3vT9xZbLmN2pRw8YcHjF6sDaE4uGtK&response_type=code&exp=1760000000&sig=Gx3kB0',
|
|
192
|
+
],
|
|
193
|
+
}),
|
|
194
|
+
})
|
|
195
|
+
|
|
196
|
+
export const response = z.union([
|
|
197
|
+
z
|
|
198
|
+
.object({
|
|
199
|
+
redirect: z.url().meta({
|
|
200
|
+
description:
|
|
201
|
+
"The app's `redirect_uri`, with the refusal of the request's key as `error` and `error_description`, `state`, and `iss`.",
|
|
202
|
+
examples: [
|
|
203
|
+
'https://app.example.com/callback?error=invalid_request&state=af0ifjsldkj',
|
|
204
|
+
],
|
|
205
|
+
}),
|
|
206
|
+
})
|
|
207
|
+
.meta({
|
|
208
|
+
description:
|
|
209
|
+
'A key that Tempo ID refuses, which returns the browser to the app.',
|
|
210
|
+
}),
|
|
211
|
+
z
|
|
212
|
+
.object({
|
|
213
|
+
request: z
|
|
214
|
+
.object({
|
|
215
|
+
account: z
|
|
216
|
+
.object({
|
|
217
|
+
address: TempoAccount.schema.tempoAccount.shape.address.meta({
|
|
218
|
+
description: 'The account address.',
|
|
219
|
+
examples: ['0x8C3b5d0e2A4f6B1c9D7e3F5a0B2c4D6e8F1a3B5c'],
|
|
220
|
+
}),
|
|
221
|
+
owner:
|
|
222
|
+
TempoAccount.schema.tempoAccount.shape.config.shape.owners.unwrap()
|
|
223
|
+
.element.shape.type,
|
|
224
|
+
})
|
|
225
|
+
.optional()
|
|
226
|
+
.meta({
|
|
227
|
+
description:
|
|
228
|
+
"The Tempo Account that the approval applies to: the account that the key names, else the app's selected account, else the user's oldest. Present only when the user holds more than one account in the app's realms.",
|
|
229
|
+
}),
|
|
230
|
+
app: z.string().meta({
|
|
231
|
+
description:
|
|
232
|
+
"The app's display name, or the host of its redirect URI without one.",
|
|
233
|
+
examples: ['Tempo Cash'],
|
|
234
|
+
}),
|
|
235
|
+
destination: z.string().meta({
|
|
236
|
+
description:
|
|
237
|
+
"The host of the app's redirect URI, or its scheme for a native app. For a third-party app, the host that serves its metadata document.",
|
|
238
|
+
examples: ['cash.tempo.xyz'],
|
|
239
|
+
}),
|
|
240
|
+
email: z.email().meta({
|
|
241
|
+
description: "The signed-in user's email address.",
|
|
242
|
+
examples: ['ada@example.com'],
|
|
243
|
+
}),
|
|
244
|
+
key: KeyAuthorization.schema.description
|
|
245
|
+
.extend({
|
|
246
|
+
chain: z
|
|
247
|
+
.object({
|
|
248
|
+
id: z
|
|
249
|
+
.number()
|
|
250
|
+
.int()
|
|
251
|
+
.meta({
|
|
252
|
+
description:
|
|
253
|
+
'The ID of the chain that the key acts on.',
|
|
254
|
+
examples: [42431],
|
|
255
|
+
}),
|
|
256
|
+
name: Chain.schema.optional().meta({
|
|
257
|
+
description:
|
|
258
|
+
'The name that `GET /v1/chains` lists for the chain. Absent for a chain that no name lists.',
|
|
259
|
+
examples: ['testnet'],
|
|
260
|
+
}),
|
|
261
|
+
})
|
|
262
|
+
.meta({ description: 'The chain that the key acts on.' }),
|
|
263
|
+
challenge: z
|
|
264
|
+
.string()
|
|
265
|
+
.optional()
|
|
266
|
+
.meta({
|
|
267
|
+
description:
|
|
268
|
+
"The message that the key's witness binds, such as a sign-in challenge from the app. Absent when the request carries none.",
|
|
269
|
+
examples: [
|
|
270
|
+
'Sign in to app.example.com\nNonce: 7f3a9c2e5b1d4f60',
|
|
271
|
+
],
|
|
272
|
+
}),
|
|
273
|
+
refusal: KeySigner.schema.refusal.optional(),
|
|
274
|
+
})
|
|
275
|
+
.optional()
|
|
276
|
+
.meta({
|
|
277
|
+
description:
|
|
278
|
+
'What the key that the request carries may do, and the account that approval signs for. Absent for a request without a key.',
|
|
279
|
+
}),
|
|
280
|
+
logo: z
|
|
281
|
+
.string()
|
|
282
|
+
.startsWith('data:image/')
|
|
283
|
+
.optional()
|
|
284
|
+
.meta({
|
|
285
|
+
description:
|
|
286
|
+
"The app's logo as a `data:` URL, which Tempo ID fetched from the origin of its client ID. Present only for an app with an origin client ID whose manifest or page names a logo.",
|
|
287
|
+
examples: ['data:image/png;base64,iVBORw0KGgo='],
|
|
288
|
+
}),
|
|
289
|
+
session: z.string().meta({
|
|
290
|
+
description:
|
|
291
|
+
'The ID of the signed-in session, which `POST /v1/authorize/consent` names.',
|
|
292
|
+
examples: ['8nVq3kZ0bT5wXy2mLp7sR4dA'],
|
|
293
|
+
}),
|
|
294
|
+
verified: z.boolean().meta({
|
|
295
|
+
description:
|
|
296
|
+
'Whether the app is a registered app, whose name the page marks as verified. A third-party app names itself in its metadata document.',
|
|
297
|
+
examples: [true],
|
|
298
|
+
}),
|
|
299
|
+
})
|
|
300
|
+
.nullable()
|
|
301
|
+
.meta({
|
|
302
|
+
description:
|
|
303
|
+
'The request that the approval page shows, or `null` for a forged or expired query, or a request without a known app.',
|
|
304
|
+
}),
|
|
305
|
+
})
|
|
306
|
+
.meta({ description: 'The request that the approval page shows.' }),
|
|
307
|
+
])
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
export namespace pageRequest {
|
|
311
|
+
export const query = request.query
|
|
312
|
+
|
|
313
|
+
export const response = request.response
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
export namespace accounts {
|
|
317
|
+
export const query = request.query
|
|
318
|
+
|
|
319
|
+
export const response = z.object({
|
|
320
|
+
request: z
|
|
321
|
+
.object({
|
|
322
|
+
accounts: z
|
|
323
|
+
.array(
|
|
324
|
+
z.object({
|
|
325
|
+
address: TempoAccount.schema.tempoAccount.shape.address.meta({
|
|
326
|
+
description: 'The account address.',
|
|
327
|
+
examples: ['0x8C3b5d0e2A4f6B1c9D7e3F5a0B2c4D6e8F1a3B5c'],
|
|
328
|
+
}),
|
|
329
|
+
balance: Balance.schema.balance.nullable().meta({
|
|
330
|
+
description:
|
|
331
|
+
"The account's holdings of USD tokens on the chain of the request's key, or of Tempo mainnet without one. `null` when the read fails or takes longer than 3 seconds.",
|
|
332
|
+
}),
|
|
333
|
+
owner:
|
|
334
|
+
TempoAccount.schema.tempoAccount.shape.config.shape.owners.unwrap()
|
|
335
|
+
.element.shape.type,
|
|
336
|
+
realm: z
|
|
337
|
+
.string()
|
|
338
|
+
.nullable()
|
|
339
|
+
.meta({
|
|
340
|
+
description:
|
|
341
|
+
"The name of the account's realm, or `null` for the `default` realm.",
|
|
342
|
+
examples: ['Tempo Cash'],
|
|
343
|
+
}),
|
|
344
|
+
}),
|
|
345
|
+
)
|
|
346
|
+
.readonly()
|
|
347
|
+
.meta({
|
|
348
|
+
description:
|
|
349
|
+
"The user's accounts in the app's realms, oldest first.",
|
|
350
|
+
}),
|
|
351
|
+
app: z.string().meta({
|
|
352
|
+
description: "The app's display name.",
|
|
353
|
+
examples: ['Tempo Cash'],
|
|
354
|
+
}),
|
|
355
|
+
})
|
|
356
|
+
.nullable()
|
|
357
|
+
.meta({
|
|
358
|
+
description:
|
|
359
|
+
'The account step, or `null` for a forged or expired query, or a request without a known app.',
|
|
360
|
+
}),
|
|
361
|
+
})
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* Reads the authorization request that `oauthQuery` carries, as the approval page shows it: the app,
|
|
367
|
+
* where the browser returns, and any key. With `preview`, it also reads the account that the approval
|
|
368
|
+
* applies to, the account that approval signs for, and why approval cannot sign the key. That read
|
|
369
|
+
* counts against the user's `ACCOUNT_LIMIT`, as `GET /v1/account` does. Returns `request: null` for a
|
|
370
|
+
* forged or expired query or an unknown app, and the app's redirect with the refusal for a key that
|
|
371
|
+
* Tempo ID refuses.
|
|
372
|
+
*/
|
|
373
|
+
async function readRequest(
|
|
374
|
+
c: Context<Env>,
|
|
375
|
+
options: readRequest.Options,
|
|
376
|
+
): Promise<
|
|
377
|
+
readRequest.ReturnType | ErrorResponse.Instance<typeof readRequest.errors>
|
|
378
|
+
> {
|
|
379
|
+
// The preview can spend the user's `ACCOUNT_LIMIT`, which a page on another site could otherwise
|
|
380
|
+
// spend by navigating a window here. No page on another site reads the request either.
|
|
381
|
+
if (c.req.header('sec-fetch-site') === 'cross-site')
|
|
382
|
+
return new ErrorResponse.CrossSiteRequestError()
|
|
383
|
+
|
|
384
|
+
const session = await Timing.measure(c, Session.get(c), 'Session.get')
|
|
385
|
+
if (!session) return new core_Auth.SessionRequiredError()
|
|
386
|
+
c.header('cache-control', 'private, no-store')
|
|
387
|
+
|
|
388
|
+
// Better Auth reads the query that the page posts with `URLSearchParams`, so the route reads it
|
|
389
|
+
// the same way, and a malformed escape cannot show one request and approve another.
|
|
390
|
+
const query = new URLSearchParams(options.oauthQuery)
|
|
391
|
+
const context = await Timing.measure(c, c.var.auth.$context, 'auth.context')
|
|
392
|
+
const verified = await Timing.measure(
|
|
393
|
+
c,
|
|
394
|
+
verifyOAuthQueryParams(options.oauthQuery, context.secret),
|
|
395
|
+
'auth.verifyOAuthQueryParams',
|
|
396
|
+
)
|
|
397
|
+
if (!verified) return { request: null }
|
|
398
|
+
|
|
399
|
+
const clientId = query.get('client_id')
|
|
400
|
+
const uri = query.get('redirect_uri')
|
|
401
|
+
const redirectUri = URL.parse(uri ?? '')
|
|
402
|
+
if (!clientId || !uri || !redirectUri) return { request: null }
|
|
403
|
+
|
|
404
|
+
// A refused key returns the browser to the redirect URI, so the app is read with no cache.
|
|
405
|
+
const app = await Timing.measure(
|
|
406
|
+
c,
|
|
407
|
+
Apps.get(db, { clientId }).catch((error: unknown) => {
|
|
408
|
+
if (error instanceof Apps.NotFoundError) return undefined
|
|
409
|
+
throw error
|
|
410
|
+
}),
|
|
411
|
+
'Apps.get',
|
|
412
|
+
)
|
|
413
|
+
// Better Auth redirects only to a registered URI, compared as a string.
|
|
414
|
+
if (!app || !app.redirectUris.includes(uri)) return { request: null }
|
|
415
|
+
|
|
416
|
+
// A refused key returns to the app with the refusal (RFC 6749 §4.1.2.1), as `/oauth2/authorize`
|
|
417
|
+
// returns one before sign-in, since a refusal page would leave the app without a callback. Each
|
|
418
|
+
// parameter follows the registered URI's own, as Better Auth appends its refusals.
|
|
419
|
+
const refuse = (error: ErrorResponse.ResponseError) => {
|
|
420
|
+
const url = new URL(uri)
|
|
421
|
+
url.searchParams.append('error', error.response.error)
|
|
422
|
+
url.searchParams.append(
|
|
423
|
+
'error_description',
|
|
424
|
+
error.response.error_description,
|
|
425
|
+
)
|
|
426
|
+
const state = query.get('state')
|
|
427
|
+
if (state) url.searchParams.append('state', state)
|
|
428
|
+
url.searchParams.append('iss', env.URL)
|
|
429
|
+
return { redirect: url.href }
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
// The page shows the key that approval signs, so the route refuses one that approval would
|
|
433
|
+
// refuse.
|
|
434
|
+
const key = Authorize.fromQuery(query)
|
|
435
|
+
if (key instanceof ErrorResponse.ResponseError) return refuse(key)
|
|
436
|
+
const refused =
|
|
437
|
+
key &&
|
|
438
|
+
Authorize.checkKey({
|
|
439
|
+
app,
|
|
440
|
+
clientId,
|
|
441
|
+
codeChallenge: query.get('code_challenge'),
|
|
442
|
+
key,
|
|
443
|
+
query,
|
|
444
|
+
})
|
|
445
|
+
if (refused) return refuse(refused)
|
|
446
|
+
|
|
447
|
+
// A custom scheme can carry an authority, as in `com.example.app://oauth/callback`, but the
|
|
448
|
+
// browser returns to whichever native app claims the scheme, so only a web URI names its host.
|
|
449
|
+
// A third-party app names its own name, so the page names the host that serves its metadata
|
|
450
|
+
// document, which every one of its redirect URIs shares.
|
|
451
|
+
const destination = (() => {
|
|
452
|
+
if (Apps.thirdParty(clientId)) return new URL(clientId).host
|
|
453
|
+
if (['http:', 'https:'].includes(redirectUri.protocol))
|
|
454
|
+
return redirectUri.host
|
|
455
|
+
return redirectUri.protocol.slice(0, -1)
|
|
456
|
+
})()
|
|
457
|
+
|
|
458
|
+
// A request without a key reads the accounts too, since the app uses the selected one. Without
|
|
459
|
+
// `preview`, the read shows no account.
|
|
460
|
+
const preview = options.preview
|
|
461
|
+
? await Timing.measure(
|
|
462
|
+
c,
|
|
463
|
+
KeySigner.preview(c, {
|
|
464
|
+
account: key?.account,
|
|
465
|
+
chainId: key?.chainId,
|
|
466
|
+
clientId,
|
|
467
|
+
email: session.user.email,
|
|
468
|
+
sessionId: session.session.id,
|
|
469
|
+
userId: session.user.id,
|
|
470
|
+
}),
|
|
471
|
+
'KeySigner.preview',
|
|
472
|
+
)
|
|
473
|
+
: undefined
|
|
474
|
+
|
|
475
|
+
// A user with several accounts sees the one that the approval applies to. A foreign account is
|
|
476
|
+
// not in the list, so the page shows no account for it.
|
|
477
|
+
const account = (() => {
|
|
478
|
+
if (!preview || preview.accounts.length < 2) return undefined
|
|
479
|
+
const found = AccountStep.find(preview.accounts, preview.account)
|
|
480
|
+
const owner = found ? TempoAccount.signer(found) : undefined
|
|
481
|
+
if (!found || !owner) return undefined
|
|
482
|
+
return { address: found.address, owner: owner.type }
|
|
483
|
+
})()
|
|
484
|
+
|
|
485
|
+
// A foreign account holds the approval like any other refusal, and never returns to the app
|
|
486
|
+
// before the user decides, so the app cannot test which accounts the user holds.
|
|
487
|
+
const shown = (() => {
|
|
488
|
+
if (!key) return undefined
|
|
489
|
+
const challenge = query.get('challenge')
|
|
490
|
+
const chainId = Number(key.chainId)
|
|
491
|
+
const name = Chain.name({ chainId, rpcUrls: env.RPC_URLS })
|
|
492
|
+
return {
|
|
493
|
+
...KeyAuthorization.describe(key),
|
|
494
|
+
...(preview?.account ? { account: preview.account } : {}),
|
|
495
|
+
chain: { id: chainId, ...(name ? { name } : {}) },
|
|
496
|
+
...(challenge ? { challenge } : {}),
|
|
497
|
+
...(preview?.refusal ? { refusal: preview.refusal } : {}),
|
|
498
|
+
}
|
|
499
|
+
})()
|
|
500
|
+
|
|
501
|
+
return {
|
|
502
|
+
request: {
|
|
503
|
+
...(account ? { account } : {}),
|
|
504
|
+
app: app.name ?? destination,
|
|
505
|
+
destination,
|
|
506
|
+
email: session.user.email,
|
|
507
|
+
...(shown ? { key: shown } : {}),
|
|
508
|
+
...(app.logo ? { logo: app.logo } : {}),
|
|
509
|
+
session: session.session.id,
|
|
510
|
+
verified: !Apps.thirdParty(clientId),
|
|
511
|
+
},
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
namespace readRequest {
|
|
516
|
+
export type Options = {
|
|
517
|
+
/** The approval page's query string, which Better Auth signed. */
|
|
518
|
+
oauthQuery: string
|
|
519
|
+
/** Whether the read holds the account that approval signs for, and why it cannot sign the key. */
|
|
520
|
+
preview: boolean
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
export type ReturnType = z.output<typeof schema.request.response>
|
|
524
|
+
|
|
525
|
+
/** The refusals `readRequest` returns. Its return type admits no other. */
|
|
526
|
+
export const errors = [
|
|
527
|
+
core_Auth.SessionRequiredError,
|
|
528
|
+
ErrorResponse.CrossSiteRequestError,
|
|
529
|
+
] as const
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
/** The authorization routes. */
|
|
533
|
+
export const authorize = new Hono<Env>()
|
|
534
|
+
.post(
|
|
535
|
+
'/v1/authorize',
|
|
536
|
+
OpenApi.describeRoute({
|
|
537
|
+
description:
|
|
538
|
+
"Authorizes the app for the signed-in user without a redirect, from a first-party app's page on the redirect URI's origin. It returns a code with `code_challenge`, or tokens to a public app without one, and signs any key within the headless ceiling. With `passkey: true`, a passkey-owned account returns the passkey step, and the repeated request with `passkey: { assertion }` and the step's `expiry` signs the key.",
|
|
539
|
+
responses: OpenApi.responses({
|
|
540
|
+
errors: [
|
|
541
|
+
...Authorize.check.errors,
|
|
542
|
+
...AccountStep.held.errors,
|
|
543
|
+
...BodyLimit.errors,
|
|
544
|
+
...OpenApi.validate.errors,
|
|
545
|
+
...RateLimit.check.errors,
|
|
546
|
+
core_Auth.SessionRequiredError,
|
|
547
|
+
ErrorResponse.CrossSiteRequestError,
|
|
548
|
+
KeyAuthorization.WebAuthnRequiredError,
|
|
549
|
+
Passkey.WebAuthnRejectedError,
|
|
550
|
+
TempoAccount.ForeignAccountError,
|
|
551
|
+
],
|
|
552
|
+
success: {
|
|
553
|
+
description: 'The authorization, or the passkey step.',
|
|
554
|
+
schema: schema.authorize.response,
|
|
555
|
+
},
|
|
556
|
+
}),
|
|
557
|
+
security: [{ sessionCookie: [] }],
|
|
558
|
+
tags: ['Authorization'],
|
|
559
|
+
}),
|
|
560
|
+
OpenApi.validate('json', schema.authorize.json),
|
|
561
|
+
async (c) => {
|
|
562
|
+
const { passkey, ...request } = c.req.valid('json')
|
|
563
|
+
const clientId = request.client_id
|
|
564
|
+
|
|
565
|
+
// A write from a first-party app's page reuses the app that `Cors.firstParty` read.
|
|
566
|
+
const app = await Timing.measure(
|
|
567
|
+
c,
|
|
568
|
+
Headless.app(c, { clientId }),
|
|
569
|
+
'Headless.app',
|
|
570
|
+
)
|
|
571
|
+
const refused = Authorize.check(request, {
|
|
572
|
+
app,
|
|
573
|
+
origin: c.req.header('origin'),
|
|
574
|
+
})
|
|
575
|
+
if (refused) return ErrorResponse.json(c, refused)
|
|
576
|
+
|
|
577
|
+
// Without a session the app shows its sign-in.
|
|
578
|
+
const session = await Timing.measure(c, Session.get(c), 'Session.get')
|
|
579
|
+
if (!session)
|
|
580
|
+
return ErrorResponse.json(c, new core_Auth.SessionRequiredError())
|
|
581
|
+
|
|
582
|
+
const authorized = await Timing.measure(
|
|
583
|
+
c,
|
|
584
|
+
Headless.authorize(c, {
|
|
585
|
+
// A user who holds no account receives a first one, as `POST /v1/account` creates it, so
|
|
586
|
+
// the app's page sends one request after any sign-in.
|
|
587
|
+
create: true,
|
|
588
|
+
headers: new Headers(c.req.raw.headers),
|
|
589
|
+
passkey: passkey === true ? {} : passkey,
|
|
590
|
+
request,
|
|
591
|
+
secret: Boolean(app!.secret),
|
|
592
|
+
session,
|
|
593
|
+
}),
|
|
594
|
+
'Headless.authorize',
|
|
595
|
+
)
|
|
596
|
+
if (authorized instanceof Response) return authorized
|
|
597
|
+
if (authorized instanceof ErrorResponse.ResponseError)
|
|
598
|
+
return ErrorResponse.json(c, authorized)
|
|
599
|
+
// A passkey signs only in the browser, so the page signs the digest and repeats the request.
|
|
600
|
+
if ('options' in authorized) {
|
|
601
|
+
c.header('cache-control', 'no-store')
|
|
602
|
+
return c.json(
|
|
603
|
+
schema.authorize.step.parse({
|
|
604
|
+
expiry: authorized.expiry,
|
|
605
|
+
step: { options: authorized.options, type: 'passkey' },
|
|
606
|
+
}),
|
|
607
|
+
200,
|
|
608
|
+
)
|
|
609
|
+
}
|
|
610
|
+
return c.json(authorized, 200)
|
|
611
|
+
},
|
|
612
|
+
)
|
|
613
|
+
.post(
|
|
614
|
+
'/v1/authorize/account',
|
|
615
|
+
OpenApi.describeRoute({
|
|
616
|
+
description:
|
|
617
|
+
"Selects the account that the app of `oauth_query` uses, and returns the next redirect of the authorization. The selection holds for the app's later authorizations in the session, and `GET /v1/account` lists it first.",
|
|
618
|
+
responses: OpenApi.responses({
|
|
619
|
+
errors: [
|
|
620
|
+
...BodyLimit.errors,
|
|
621
|
+
...Cors.ownPage.errors,
|
|
622
|
+
...OpenApi.validate.errors,
|
|
623
|
+
...AccountStep.accounts.errors,
|
|
624
|
+
...RateLimit.check.errors,
|
|
625
|
+
core_Auth.AuthorizationExpiredError,
|
|
626
|
+
core_Auth.SessionRequiredError,
|
|
627
|
+
TempoAccount.ForeignAccountError,
|
|
628
|
+
],
|
|
629
|
+
success: {
|
|
630
|
+
description: 'The next redirect, or the passkey step.',
|
|
631
|
+
schema: schema.account.response,
|
|
632
|
+
},
|
|
633
|
+
}),
|
|
634
|
+
security: [{ sessionCookie: [] }],
|
|
635
|
+
tags: ['Authorization'],
|
|
636
|
+
}),
|
|
637
|
+
OpenApi.validate('json', schema.account.json),
|
|
638
|
+
async (c) => {
|
|
639
|
+
const { account, oauth_query, passkey } = c.req.valid('json')
|
|
640
|
+
const crossSite = Cors.ownPage(c, { oauth_query })
|
|
641
|
+
if (crossSite) return ErrorResponse.json(c, crossSite)
|
|
642
|
+
|
|
643
|
+
const session = await Timing.measure(c, Session.get(c), 'Session.get')
|
|
644
|
+
if (!session)
|
|
645
|
+
return ErrorResponse.json(c, new core_Auth.SessionRequiredError())
|
|
646
|
+
|
|
647
|
+
// The account lookup can call every realm's Privy app, so it counts against the user's
|
|
648
|
+
// account reads, as `GET /v1/account` does.
|
|
649
|
+
const refused = await Timing.measure(
|
|
650
|
+
c,
|
|
651
|
+
RateLimit.check(c, {
|
|
652
|
+
limits: [{ binding: 'ACCOUNT_LIMIT', key: session.user.id }],
|
|
653
|
+
}),
|
|
654
|
+
'RateLimit.check',
|
|
655
|
+
)
|
|
656
|
+
if (refused) return refused
|
|
657
|
+
|
|
658
|
+
// The account lookup reads only a signed query, so a forged one learns nothing about the user.
|
|
659
|
+
const context = await Timing.measure(
|
|
660
|
+
c,
|
|
661
|
+
c.var.auth.$context,
|
|
662
|
+
'auth.context',
|
|
663
|
+
)
|
|
664
|
+
const verified = await Timing.measure(
|
|
665
|
+
c,
|
|
666
|
+
verifyOAuthQueryParams(oauth_query, context.secret),
|
|
667
|
+
'auth.verifyOAuthQueryParams',
|
|
668
|
+
)
|
|
669
|
+
const query = new URLSearchParams(oauth_query)
|
|
670
|
+
const clientId = query.get('client_id')
|
|
671
|
+
if (!verified || !clientId)
|
|
672
|
+
return ErrorResponse.json(c, new core_Auth.AuthorizationExpiredError())
|
|
673
|
+
// The continued authorization can store a code for the redirect URI, so it is checked first.
|
|
674
|
+
Consent.checkRedirect(query)
|
|
675
|
+
|
|
676
|
+
// The selection names the account at its address on the key's chain, as the step lists it.
|
|
677
|
+
const key = Authorize.fromQuery(query)
|
|
678
|
+
const accounts = await Timing.measure(
|
|
679
|
+
c,
|
|
680
|
+
AccountStep.accounts(c, {
|
|
681
|
+
chainId:
|
|
682
|
+
key && !(key instanceof ErrorResponse.ResponseError) && key.chainId
|
|
683
|
+
? Number(key.chainId)
|
|
684
|
+
: KeyAuthorization.defaultChainId,
|
|
685
|
+
clientId,
|
|
686
|
+
userId: session.user.id,
|
|
687
|
+
}),
|
|
688
|
+
'AccountStep.accounts',
|
|
689
|
+
)
|
|
690
|
+
if (!AccountStep.find(accounts, account))
|
|
691
|
+
return ErrorResponse.json(
|
|
692
|
+
c,
|
|
693
|
+
new TempoAccount.ForeignAccountError({ account }),
|
|
694
|
+
)
|
|
695
|
+
// The route read the accounts and found the selection among them, so the continued
|
|
696
|
+
// authorization reads them no second time.
|
|
697
|
+
c.set('accountChosen', true)
|
|
698
|
+
|
|
699
|
+
// The approval that a sign-in with the request's key continues reads the new selection.
|
|
700
|
+
const selection = AccountStep.select({
|
|
701
|
+
account: account.toLowerCase(),
|
|
702
|
+
clientId,
|
|
703
|
+
cookie: c.req.header('cookie'),
|
|
704
|
+
sessionId: session.session.id,
|
|
705
|
+
})
|
|
706
|
+
const headers = new Headers(c.req.raw.headers)
|
|
707
|
+
headers.set('cookie', selection.header)
|
|
708
|
+
const result = await Timing.measure(
|
|
709
|
+
c,
|
|
710
|
+
c.var.auth.api.oauth2Continue({
|
|
711
|
+
// A call with a request returns a `Response` unless `asResponse` is false.
|
|
712
|
+
asResponse: false,
|
|
713
|
+
body: { oauth_query, postLogin: true },
|
|
714
|
+
headers,
|
|
715
|
+
request: new Request(c.req.url, { headers, method: 'POST' }),
|
|
716
|
+
}),
|
|
717
|
+
'auth.oauth2Continue',
|
|
718
|
+
).catch((error: unknown) => {
|
|
719
|
+
// Better Auth refuses a forged or expired request before it continues the authorization.
|
|
720
|
+
if (isAPIError(error) && error.body?.error === 'invalid_signature')
|
|
721
|
+
return new core_Auth.AuthorizationExpiredError()
|
|
722
|
+
throw error
|
|
723
|
+
})
|
|
724
|
+
if (result instanceof ErrorResponse.ResponseError)
|
|
725
|
+
return ErrorResponse.json(c, result)
|
|
726
|
+
|
|
727
|
+
// A sign-in that showed the request's key held its grant for this step, which takes it.
|
|
728
|
+
const next = await Timing.measure(
|
|
729
|
+
c,
|
|
730
|
+
SignInConsent.afterAccountStep(c, {
|
|
731
|
+
account,
|
|
732
|
+
assertion: passkey?.assertion,
|
|
733
|
+
headers,
|
|
734
|
+
redirect: schema.account.result.parse(result).url,
|
|
735
|
+
session,
|
|
736
|
+
}),
|
|
737
|
+
'SignInConsent.afterAccountStep',
|
|
738
|
+
)
|
|
739
|
+
|
|
740
|
+
c.header('set-cookie', selection.setCookie, { append: true })
|
|
741
|
+
c.header('cache-control', 'private, no-store')
|
|
742
|
+
// A passkey signs only in this browser, so the page signs the digest and repeats the selection.
|
|
743
|
+
if ('options' in next)
|
|
744
|
+
return c.json(
|
|
745
|
+
Passkey.schema.step.parse({
|
|
746
|
+
step: { options: next.options, type: 'passkey' },
|
|
747
|
+
}),
|
|
748
|
+
200,
|
|
749
|
+
)
|
|
750
|
+
return c.json({ redirect: next.redirect }, 200)
|
|
751
|
+
},
|
|
752
|
+
)
|
|
753
|
+
.post(
|
|
754
|
+
'/v1/authorize/consent',
|
|
755
|
+
OpenApi.describeRoute({
|
|
756
|
+
description:
|
|
757
|
+
"Records the signed-in user's decision on the request in `oauth_query`, stores an approval's consent, and returns the app's redirect. An approval of a key authorization signs the key. If the key names no account and the user holds none, the approval first creates an account.",
|
|
758
|
+
responses: OpenApi.responses({
|
|
759
|
+
errors: [
|
|
760
|
+
...Authorize.checkKey.errors,
|
|
761
|
+
...BodyLimit.errors,
|
|
762
|
+
...Cors.ownPage.errors,
|
|
763
|
+
...KeySigner.resolve.errors,
|
|
764
|
+
...KeySigner.sign.errors,
|
|
765
|
+
...KeySigner.unlinked.errors,
|
|
766
|
+
...OpenApi.validate.errors,
|
|
767
|
+
...RateLimit.check.errors,
|
|
768
|
+
Authorize.RejectedError,
|
|
769
|
+
core_Auth.AuthorizationExpiredError,
|
|
770
|
+
core_Auth.SessionChangedError,
|
|
771
|
+
core_Auth.SessionRequiredError,
|
|
772
|
+
Validation.InvalidFieldError,
|
|
773
|
+
],
|
|
774
|
+
success: {
|
|
775
|
+
description: "The app's redirect, or the passkey step.",
|
|
776
|
+
schema: schema.consent.response,
|
|
777
|
+
},
|
|
778
|
+
}),
|
|
779
|
+
security: [{ sessionCookie: [] }],
|
|
780
|
+
tags: ['Authorization'],
|
|
781
|
+
}),
|
|
782
|
+
OpenApi.validate('json', schema.consent.json),
|
|
783
|
+
async (c) => {
|
|
784
|
+
const {
|
|
785
|
+
accept,
|
|
786
|
+
account,
|
|
787
|
+
oauth_query,
|
|
788
|
+
passkey,
|
|
789
|
+
session_id,
|
|
790
|
+
skip_upgrade,
|
|
791
|
+
} = c.req.valid('json')
|
|
792
|
+
const crossSite = Cors.ownPage(c, { oauth_query })
|
|
793
|
+
if (crossSite) return ErrorResponse.json(c, crossSite)
|
|
794
|
+
|
|
795
|
+
const session = await Timing.measure(c, Session.get(c), 'Session.get')
|
|
796
|
+
if (!session)
|
|
797
|
+
return ErrorResponse.json(c, new core_Auth.SessionRequiredError())
|
|
798
|
+
// A sign-in in another tab replaces the session, and the page still names the earlier account.
|
|
799
|
+
if (session.session.id !== session_id)
|
|
800
|
+
return ErrorResponse.json(c, new core_Auth.SessionChangedError())
|
|
801
|
+
|
|
802
|
+
// Better Auth stores the consent before it returns the redirect, so the signed redirect URI is
|
|
803
|
+
// checked first, or an approval would let the app's next request reach it without this page.
|
|
804
|
+
const context = await Timing.measure(
|
|
805
|
+
c,
|
|
806
|
+
c.var.auth.$context,
|
|
807
|
+
'auth.context',
|
|
808
|
+
)
|
|
809
|
+
const verified = await Timing.measure(
|
|
810
|
+
c,
|
|
811
|
+
verifyOAuthQueryParams(oauth_query, context.secret),
|
|
812
|
+
'auth.verifyOAuthQueryParams',
|
|
813
|
+
)
|
|
814
|
+
if (!verified)
|
|
815
|
+
return ErrorResponse.json(c, new core_Auth.AuthorizationExpiredError())
|
|
816
|
+
const query = new URLSearchParams(oauth_query)
|
|
817
|
+
Consent.checkRedirect(query)
|
|
818
|
+
|
|
819
|
+
// Each approval of a key reads the user's accounts and calls Privy, as a headless
|
|
820
|
+
// authorization does. The repeated approval of the passkey step counts too, since it reads
|
|
821
|
+
// the same owners before its assertion is checked.
|
|
822
|
+
const keyed =
|
|
823
|
+
accept && (query.has('key_authorization') || query.has('challenge'))
|
|
824
|
+
const limited = keyed
|
|
825
|
+
? await Timing.measure(
|
|
826
|
+
c,
|
|
827
|
+
RateLimit.check(c, {
|
|
828
|
+
limits: [{ binding: 'AUTHORIZE_LIMIT', key: session.user.id }],
|
|
829
|
+
}),
|
|
830
|
+
'RateLimit.check',
|
|
831
|
+
)
|
|
832
|
+
: undefined
|
|
833
|
+
if (limited) return limited
|
|
834
|
+
|
|
835
|
+
// An approval signs the key before Better Auth issues the code, so a refused key issues none.
|
|
836
|
+
if (accept) {
|
|
837
|
+
const approved = await Timing.measure(
|
|
838
|
+
c,
|
|
839
|
+
Consent.approve(c, {
|
|
840
|
+
account,
|
|
841
|
+
assertion: passkey?.assertion,
|
|
842
|
+
email: session.user.email,
|
|
843
|
+
headers: new Headers(c.req.raw.headers),
|
|
844
|
+
oauthQuery: oauth_query,
|
|
845
|
+
session,
|
|
846
|
+
skipUpgrade: skip_upgrade,
|
|
847
|
+
}),
|
|
848
|
+
'Consent.approve',
|
|
849
|
+
)
|
|
850
|
+
if (approved instanceof ErrorResponse.ResponseError)
|
|
851
|
+
return ErrorResponse.json(c, approved)
|
|
852
|
+
c.header('cache-control', 'private, no-store')
|
|
853
|
+
// A passkey signs only in this browser, so the page signs the digest and repeats the approval.
|
|
854
|
+
if ('options' in approved)
|
|
855
|
+
return c.json(
|
|
856
|
+
schema.consent.step.parse({
|
|
857
|
+
step: { options: approved.options, type: 'passkey' },
|
|
858
|
+
}),
|
|
859
|
+
200,
|
|
860
|
+
)
|
|
861
|
+
return c.json({ redirect: approved.redirect }, 200)
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
const result = await Timing.measure(
|
|
865
|
+
c,
|
|
866
|
+
c.var.auth.api.oauth2Consent({
|
|
867
|
+
// A call with a request returns a `Response` unless `asResponse` is false.
|
|
868
|
+
asResponse: false,
|
|
869
|
+
body: { accept, oauth_query },
|
|
870
|
+
// Better Auth sets `accept` to continue an authorization as JSON, and a request's own headers
|
|
871
|
+
// are immutable.
|
|
872
|
+
headers: new Headers(c.req.raw.headers),
|
|
873
|
+
// An authorization that asks to sign in again continues through the request.
|
|
874
|
+
request: c.req.raw,
|
|
875
|
+
}),
|
|
876
|
+
'auth.oauth2Consent',
|
|
877
|
+
).catch((error: unknown) => {
|
|
878
|
+
// Better Auth refuses a forged or expired request before it stores anything.
|
|
879
|
+
if (isAPIError(error) && error.body?.error === 'invalid_signature')
|
|
880
|
+
return new core_Auth.AuthorizationExpiredError()
|
|
881
|
+
throw error
|
|
882
|
+
})
|
|
883
|
+
if (result instanceof ErrorResponse.ResponseError)
|
|
884
|
+
return ErrorResponse.json(c, result)
|
|
885
|
+
|
|
886
|
+
c.header('cache-control', 'private, no-store')
|
|
887
|
+
return c.json({ redirect: schema.account.result.parse(result).url }, 200)
|
|
888
|
+
},
|
|
889
|
+
)
|
|
890
|
+
.get(
|
|
891
|
+
'/v1/authorize/request',
|
|
892
|
+
OpenApi.describeRoute({
|
|
893
|
+
description:
|
|
894
|
+
"Reads the authorization request in `oauth_query` as the approval page shows it: the app, the destination, the account, and any key. For a key that Tempo ID refuses, it returns the app's redirect with the refusal.",
|
|
895
|
+
responses: OpenApi.responses({
|
|
896
|
+
errors: [
|
|
897
|
+
...OpenApi.validate.errors,
|
|
898
|
+
core_Auth.SessionRequiredError,
|
|
899
|
+
ErrorResponse.CrossSiteRequestError,
|
|
900
|
+
],
|
|
901
|
+
success: {
|
|
902
|
+
description: "The request, or the app's redirect with a refusal.",
|
|
903
|
+
schema: schema.request.response,
|
|
904
|
+
},
|
|
905
|
+
}),
|
|
906
|
+
security: [{ sessionCookie: [] }],
|
|
907
|
+
tags: ['Authorization'],
|
|
908
|
+
}),
|
|
909
|
+
OpenApi.validate('query', schema.request.query),
|
|
910
|
+
async (c) => {
|
|
911
|
+
const result = await Timing.measure(
|
|
912
|
+
c,
|
|
913
|
+
readRequest(c, {
|
|
914
|
+
oauthQuery: c.req.valid('query').oauth_query,
|
|
915
|
+
preview: true,
|
|
916
|
+
}),
|
|
917
|
+
'authorize.readRequest',
|
|
918
|
+
)
|
|
919
|
+
if (result instanceof ErrorResponse.ResponseError)
|
|
920
|
+
return ErrorResponse.json(c, result)
|
|
921
|
+
return c.json(result, 200)
|
|
922
|
+
},
|
|
923
|
+
)
|
|
924
|
+
// The approval page renders from this read, and streams in the account from
|
|
925
|
+
// `GET /v1/authorize/request`, whose owners' lookup can call every realm's Privy app.
|
|
926
|
+
.get(
|
|
927
|
+
'/i/authorize/request',
|
|
928
|
+
OpenApi.describeRoute({
|
|
929
|
+
description:
|
|
930
|
+
"Reads the app's authorization request that `oauth_query` carries, as `GET /v1/authorize/request` does, without the account that the approval applies to, the account that approval signs for, or why approval cannot sign the key. The read holds no account, so it does not count against the user's `ACCOUNT_LIMIT`. Internal: only Tempo ID's approval page sends the request, so the public document leaves it out.",
|
|
931
|
+
// Internal routes stay out of `/openapi.json` and `/docs`.
|
|
932
|
+
hide: true,
|
|
933
|
+
responses: OpenApi.responses({
|
|
934
|
+
errors: [...OpenApi.validate.errors, ...readRequest.errors],
|
|
935
|
+
success: {
|
|
936
|
+
description: "The request, or the app's redirect with a refusal.",
|
|
937
|
+
schema: schema.pageRequest.response,
|
|
938
|
+
},
|
|
939
|
+
}),
|
|
940
|
+
security: [{ sessionCookie: [] }],
|
|
941
|
+
tags: ['Authorization'],
|
|
942
|
+
}),
|
|
943
|
+
OpenApi.validate('query', schema.pageRequest.query),
|
|
944
|
+
async (c) => {
|
|
945
|
+
const result = await Timing.measure(
|
|
946
|
+
c,
|
|
947
|
+
readRequest(c, {
|
|
948
|
+
oauthQuery: c.req.valid('query').oauth_query,
|
|
949
|
+
preview: false,
|
|
950
|
+
}),
|
|
951
|
+
'authorize.readRequest',
|
|
952
|
+
)
|
|
953
|
+
if (result instanceof ErrorResponse.ResponseError)
|
|
954
|
+
return ErrorResponse.json(c, result)
|
|
955
|
+
return c.json(result, 200)
|
|
956
|
+
},
|
|
957
|
+
)
|
|
958
|
+
.get(
|
|
959
|
+
'/v1/authorize/accounts',
|
|
960
|
+
OpenApi.describeRoute({
|
|
961
|
+
description:
|
|
962
|
+
"Reads the account step of the authorization request in `oauth_query`: the app, and the user's accounts in its realms, oldest first. Each account carries its balance on the chain of the request's key, or of Tempo mainnet without a key.",
|
|
963
|
+
responses: OpenApi.responses({
|
|
964
|
+
errors: [
|
|
965
|
+
...AccountStep.accounts.errors,
|
|
966
|
+
...OpenApi.validate.errors,
|
|
967
|
+
...RateLimit.check.errors,
|
|
968
|
+
core_Auth.SessionRequiredError,
|
|
969
|
+
ErrorResponse.CrossSiteRequestError,
|
|
970
|
+
],
|
|
971
|
+
success: {
|
|
972
|
+
description: 'The account step.',
|
|
973
|
+
schema: schema.accounts.response,
|
|
974
|
+
},
|
|
975
|
+
}),
|
|
976
|
+
security: [{ sessionCookie: [] }],
|
|
977
|
+
tags: ['Authorization'],
|
|
978
|
+
}),
|
|
979
|
+
OpenApi.validate('query', schema.accounts.query),
|
|
980
|
+
async (c) => {
|
|
981
|
+
// A page on another site could otherwise spend the user's `ACCOUNT_LIMIT` by navigating a
|
|
982
|
+
// window here.
|
|
983
|
+
if (c.req.header('sec-fetch-site') === 'cross-site')
|
|
984
|
+
return ErrorResponse.json(c, new ErrorResponse.CrossSiteRequestError())
|
|
985
|
+
|
|
986
|
+
const session = await Timing.measure(c, Session.get(c), 'Session.get')
|
|
987
|
+
if (!session)
|
|
988
|
+
return ErrorResponse.json(c, new core_Auth.SessionRequiredError())
|
|
989
|
+
c.header('cache-control', 'private, no-store')
|
|
990
|
+
|
|
991
|
+
const { oauth_query } = c.req.valid('query')
|
|
992
|
+
const query = new URLSearchParams(oauth_query)
|
|
993
|
+
const context = await Timing.measure(
|
|
994
|
+
c,
|
|
995
|
+
c.var.auth.$context,
|
|
996
|
+
'auth.context',
|
|
997
|
+
)
|
|
998
|
+
const verified = await Timing.measure(
|
|
999
|
+
c,
|
|
1000
|
+
verifyOAuthQueryParams(oauth_query, context.secret),
|
|
1001
|
+
'auth.verifyOAuthQueryParams',
|
|
1002
|
+
)
|
|
1003
|
+
const clientId = query.get('client_id')
|
|
1004
|
+
if (!verified || !clientId) return c.json({ request: null }, 200)
|
|
1005
|
+
|
|
1006
|
+
// The selection continues through Better Auth, which reads the app again.
|
|
1007
|
+
const app = await Timing.measure(
|
|
1008
|
+
c,
|
|
1009
|
+
Cache.read(
|
|
1010
|
+
c,
|
|
1011
|
+
() =>
|
|
1012
|
+
Apps.get(db, { clientId }).catch((error: unknown) => {
|
|
1013
|
+
if (error instanceof Apps.NotFoundError) return undefined
|
|
1014
|
+
throw error
|
|
1015
|
+
}),
|
|
1016
|
+
['apps.get', clientId],
|
|
1017
|
+
),
|
|
1018
|
+
'Apps.get',
|
|
1019
|
+
)
|
|
1020
|
+
if (!app) return c.json({ request: null }, 200)
|
|
1021
|
+
|
|
1022
|
+
// The account lookup can call every realm's Privy app, so it counts against the user's account
|
|
1023
|
+
// reads, as `GET /v1/account` does.
|
|
1024
|
+
const refused = await Timing.measure(
|
|
1025
|
+
c,
|
|
1026
|
+
RateLimit.check(c, {
|
|
1027
|
+
limits: [{ binding: 'ACCOUNT_LIMIT', key: session.user.id }],
|
|
1028
|
+
}),
|
|
1029
|
+
'RateLimit.check',
|
|
1030
|
+
)
|
|
1031
|
+
if (refused) return refused
|
|
1032
|
+
|
|
1033
|
+
// A key that names no chain acts on the default chain. A key that does not parse falls back to
|
|
1034
|
+
// it too, and the approval page refuses it. The accounts are listed at their addresses there.
|
|
1035
|
+
const key = Authorize.fromQuery(query)
|
|
1036
|
+
const chainId =
|
|
1037
|
+
key && !(key instanceof ErrorResponse.ResponseError) && key.chainId
|
|
1038
|
+
? Number(key.chainId)
|
|
1039
|
+
: KeyAuthorization.defaultChainId
|
|
1040
|
+
const accounts = await Timing.measure(
|
|
1041
|
+
c,
|
|
1042
|
+
AccountStep.accounts(c, {
|
|
1043
|
+
chainId,
|
|
1044
|
+
clientId,
|
|
1045
|
+
userId: session.user.id,
|
|
1046
|
+
}),
|
|
1047
|
+
'AccountStep.accounts',
|
|
1048
|
+
)
|
|
1049
|
+
|
|
1050
|
+
// Each Tempo Account has an owner, so the guard only narrows the read.
|
|
1051
|
+
const owned = accounts.flatMap((account) => {
|
|
1052
|
+
const owner = TempoAccount.signer(account)
|
|
1053
|
+
if (!owner) return []
|
|
1054
|
+
return [
|
|
1055
|
+
{
|
|
1056
|
+
address: account.address,
|
|
1057
|
+
owner: owner.type,
|
|
1058
|
+
// The `default` realm goes unnamed, so a row names only a realm such as Tempo Cash.
|
|
1059
|
+
realm:
|
|
1060
|
+
account.realm.id === Realm.defaultId ? null : account.realm.name,
|
|
1061
|
+
},
|
|
1062
|
+
]
|
|
1063
|
+
})
|
|
1064
|
+
const balances = await Timing.measure(
|
|
1065
|
+
c,
|
|
1066
|
+
Balance.list(c, {
|
|
1067
|
+
accounts: owned,
|
|
1068
|
+
apiUrl: Chain.apiUrl({ apiUrls: env.TEMPO_API_URLS, chainId }),
|
|
1069
|
+
chainId,
|
|
1070
|
+
}),
|
|
1071
|
+
'Balance.list',
|
|
1072
|
+
)
|
|
1073
|
+
return c.json(
|
|
1074
|
+
{
|
|
1075
|
+
request: {
|
|
1076
|
+
accounts: owned.map((account, index) => ({
|
|
1077
|
+
...account,
|
|
1078
|
+
balance: balances[index] ?? null,
|
|
1079
|
+
})),
|
|
1080
|
+
app: app.name ?? 'The app',
|
|
1081
|
+
},
|
|
1082
|
+
},
|
|
1083
|
+
200,
|
|
1084
|
+
)
|
|
1085
|
+
},
|
|
1086
|
+
)
|