{"_id":"@bogeychan/elysia-oauth2","_rev":"16-c287a74a02cd1742c46f414716b728a7","name":"@bogeychan/elysia-oauth2","dist-tags":{"latest":"0.1.0"},"versions":{"0.0.7":{"name":"@bogeychan/elysia-oauth2","version":"0.0.7","keywords":["elysia","oauth2","bun"],"author":{"url":"https://github.com/bogeychan","name":"bogeychan","email":"bogeychan@outlook.com"},"license":"MIT","_id":"@bogeychan/elysia-oauth2@0.0.7","maintainers":[{"name":"bogeychan","email":"bogeychan@outlook.com"}],"homepage":"https://github.com/bogeychan/elysia-oauth2","bugs":{"url":"https://github.com/bogeychan/elysia-oauth2/issues"},"dist":{"shasum":"b1bbda89a7242c605ffc4bf961510cf5cc0fb147","tarball":"https://registry.npmjs.org/@bogeychan/elysia-oauth2/-/elysia-oauth2-0.0.7.tgz","fileCount":13,"integrity":"sha512-EpbDwnp1scIsoUsZPqC2kYCsFMSCWTe8xbVJVxqE1kVzrWmkyctRJzBHnGRyqAcRGSb57Tw5ULLGP+T9mAVRFg==","signatures":[{"sig":"MEQCIAHzcotSoHanxiSvh/h+buzzCWclDVP+xRsG5nLMTbs2AiBPa3Wpf8kSup1XEOkqnVY85LmThnBJu1abA7XibftVdQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26125,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjp8jSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrrTQ/9GJEER8LXtxC3nqjbPl62KJtaQ2KbK65KpDrhCIZvcjO+yfDA\r\nn54JvzstQxvH/7M7LK1tdpwzkRrk9vHvSssXig9dILAa6wl/edOiHDn7fP93\r\nQOCLAjjmKD3MjRUgUa8xL9rXmYMzO/T1nzAtm2V6ACxPF+3K8VoznAh88aeC\r\n7T9+aIzTqqq85qQLNOZXDhKgq5OS0xVMLuhwSwiYsKNzdZFf4UrJvN3tFrRV\r\nlGy1pqjX2hF860HWAX/EXxyZHE5ARPQZIAe9aX2T3PsPOhEii6RvACbJiVgO\r\nmz561d8urJ3NvPUT3AOlmlmRRM8+CLB65RXFInvPsqmsHyTojMqsaikw6Sm8\r\n3+8ykVfdHsfxkXgwpecGGtZr5tCMdGZNDBpmJW/UY62nqRd3iVvfT/NmBGIT\r\n5FOXjPhSprlZ7XO4mITgtKVDQbvTUpc+Kk3qimlSgBvUrjEgXhwjUCCMPiMw\r\n3HKrLY+UeVlltPqucgieHyme/cDshf7EUXfV7mVf5apTwJjy11MjvCD16tMI\r\ndYIKnYaq9zUiiufqGu+25MiZfSYuBJcOTGUKTSh7LKNrfU1Fb52hYquoJts6\r\ndD82ccLXywYWMGIVJCT/WkmCEpTdILST40DchnowcadzBsayZmS5TTQ471so\r\nvpcKQXTCiHTKX4JyUnOyfwi5l4qy6cNf2zs=\r\n=mAcT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"src/index.ts","type":"module","types":"src/index.ts","gitHead":"10ea757371aa204e2b1cfe617260fcbf745e2112","_npmUser":{"name":"bogeychan","email":"bogeychan@outlook.com"},"repository":{"url":"git+https://github.com/bogeychan/elysia-oauth2.git","type":"git"},"_npmVersion":"7.21.1","description":"A plugin for elysia for server-side OAuth 2.0 Authorization Code Flow","directories":{},"_nodeVersion":"16.8.0","_hasShrinkwrap":false,"devDependencies":{"elysia":"^0.1.0","bun-types":"^0.4.0","typescript":"^4.9.4"},"peerDependencies":{"elysia":">= 0.1.0"},"_npmOperationalInternal":{"tmp":"tmp/elysia-oauth2_0.0.7_1671940306609_0.6763421027442156","host":"s3://npm-registry-packages"}},"0.0.8":{"name":"@bogeychan/elysia-oauth2","version":"0.0.8","keywords":["elysia","oauth2","bun"],"author":{"url":"https://github.com/bogeychan","name":"bogeychan","email":"bogeychan@outlook.com"},"license":"MIT","_id":"@bogeychan/elysia-oauth2@0.0.8","maintainers":[{"name":"bogeychan","email":"bogeychan@outlook.com"}],"homepage":"https://github.com/bogeychan/elysia-oauth2","bugs":{"url":"https://github.com/bogeychan/elysia-oauth2/issues"},"dist":{"shasum":"ac44c3e0ab2d59a60c7b799c7313945da7c638a6","tarball":"https://registry.npmjs.org/@bogeychan/elysia-oauth2/-/elysia-oauth2-0.0.8.tgz","fileCount":13,"integrity":"sha512-J40fIB+C6aukmswmAbSvg1CKDqtN2eF9PdQ7xio3vBp/9oiVKfX0Io396kLJ1N0YiEJHyjBfoD2ouR7J6cQTVA==","signatures":[{"sig":"MEQCIHbmBMhTshmu0kgfnDI2I3rPdZxUpRKi6yDYoB3aeXQ8AiA1MnCl/BSvXK61U+8lw8q5lkNhrs+S9hCJ3DlccX6rrw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26062,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj5W/7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp60xAAmLvnaS4TZWqs0j65Aq2l0gWlLBcg/RtcNMuW5aOcK5DmVawS\r\nXEv7GLiEr1o/0aRKCbNokp5a/h3BGdrshmRjWHqDgrTW95rEpRxL3D7oSgb1\r\nPDmQyuFhSBOv3fTvnG+aBAWXOBtJkkvqlyRW4yhjDx7kZoc0rK+IwGOfChp1\r\n9FZ5fgSsBWgntxDU0FmUIZT6spKtS8TD6oOVlSpFQJiZPXTAHvobV0jR6sdy\r\nNNI8vFIjLMoQJaxxMk0VC06jtU2GAQHYpiyHRbMJ/ZtvB8Ah7c49NayTQ/tI\r\n+ALAn/Bv8yLlreDbpv4j6A96E4ggwyka7I/jyytX9kKAwKtU2qh3f3xfAVe8\r\nwxGYVjUT5OTxFq4Elfs0JpG+W3lr6YTwiToBDGQYBuCWZGNjPzSXmYlpLYBm\r\nZJ2AmyJw9k1dZABOJr/RG1e6x1zX2OgnZ10I0hQWN9b8pNOI2ugYS4CwmO5u\r\n0PH/P1qvP0AQ+Vtj5qDhUBdltXEHXqZ+kbvQZeYvjWdaQsYpBFdERS1RyNNK\r\n8IAF/oj5/AqJkQxlsLnZ26n7EZfOT713BAdoy1n/1d6T3OMaXjDvKDRfEEZq\r\nk3GWSOs7SLYVZ3E+xLMzrSQ2FZ4rhItZ7oQJqkdpQSEW5YLUZQCWeDWr8YiF\r\n4v/PRekKjTnhxctR6CpO+/q15NHzOKmbjZY=\r\n=dNdH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"src/index.ts","type":"module","types":"src/index.ts","gitHead":"7cda79bfe3043d44bcdc8c1be69ef8b660a2129a","_npmUser":{"name":"bogeychan","email":"bogeychan@outlook.com"},"repository":{"url":"git+https://github.com/bogeychan/elysia-oauth2.git","type":"git"},"_npmVersion":"7.21.1","description":"A plugin for elysia for server-side OAuth 2.0 Authorization Code Flow","directories":{},"_nodeVersion":"16.8.0","_hasShrinkwrap":false,"devDependencies":{"elysia":"^0.2.5","bun-types":"^0.5.6","typescript":"^4.9.5"},"peerDependencies":{"elysia":">= 0.2.5"},"_npmOperationalInternal":{"tmp":"tmp/elysia-oauth2_0.0.8_1675980795144_0.9731352649670353","host":"s3://npm-registry-packages"}},"0.0.9":{"name":"@bogeychan/elysia-oauth2","version":"0.0.9","keywords":["elysia","oauth2","bun"],"author":{"url":"https://github.com/bogeychan","name":"bogeychan","email":"bogeychan@outlook.com"},"license":"MIT","_id":"@bogeychan/elysia-oauth2@0.0.9","maintainers":[{"name":"bogeychan","email":"bogeychan@outlook.com"}],"homepage":"https://github.com/bogeychan/elysia-oauth2","bugs":{"url":"https://github.com/bogeychan/elysia-oauth2/issues"},"dist":{"shasum":"c757b1e15885e39b8bf10d8ef7ef66680324caff","tarball":"https://registry.npmjs.org/@bogeychan/elysia-oauth2/-/elysia-oauth2-0.0.9.tgz","fileCount":13,"integrity":"sha512-XshjEfUGtBNSQhRvp8uJLBvIWCTqYGnAJwdunMp/ZwZDU+hsyZGCvWLu5PfdccgYtBdYlvBSQJnTv/3U0O4oHg==","signatures":[{"sig":"MEUCIQCnzWQIriNTP26uTiHAw6B1/MXVAt+smciXmGh4QNfPIAIgCK7wPqnF4VLSwIjs7p/Hk2ZIJWIV28Jb+HydpCuu17E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26150,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkKHD9ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp7GQ//QOUphBPGt0aaThcJ/I6tX17bHpeqLi8s6YxqmeLOy9W5XaCb\r\n9AQOvDeo4mr33pDuLvaaM0zgPzUyq+JP0xSo0NURjCcp5MBNBfevj+vB5N7E\r\nNLAAgSgvx2Tsmk8Ya+2foQqDqd8rgf9YUlyo+n6zhwIFhyyOyVm8IfkL37Y4\r\nMUG/oHYVJ85g63Qk2NK8Cd0a8SmxQznp7uBT51YLjvrwGIloUaA2J6z0/MJ5\r\nwEVFveZPEot1MEdVPeD5DiFxfozaCtgn52OWt638FkrZVdGcZb37PcZzAAt/\r\nCBe9Gu+q4k8j7Ql8/5MVBS6kYVsq1BKxLGLSy0CqDjzPDS5R3mIXsKwFR42D\r\n14TpfRWyzdOxM4rCnkZUP37XBLSLDECxUraOdHMQEB7QOtBDiR6WRGzeKjQl\r\nWRvYpbSy09o6mwBcM2gwyyhFNXSadTqkoYE3z272t0SYmd2+apdXThLqcf0g\r\ngnZxhaoh8QRMv5lNvb1bF8Sd5cjNHws6WtR6T4cJUJ0TeQd72wICeWFcL2nN\r\n5B5Fwckv1Ev11HIHEyGDLSojtnAdpwaqxIzShtlaRb3qlBLaRzzxkl7wN2oC\r\nGoA8qnPLLQeewcv05Arp0dtSJkjeEgRLBhQdZLYaooAtiylcsqk4r94vGuCu\r\nQXzGnX2upwORAaUAB8paXt1hkyJ1DncIryU=\r\n=ElaA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"src/index.ts","type":"module","types":"src/index.ts","gitHead":"0702b5313c4ef49625ed708eff1fa34a7a6e6c2c","_npmUser":{"name":"bogeychan","email":"bogeychan@outlook.com"},"repository":{"url":"git+https://github.com/bogeychan/elysia-oauth2.git","type":"git"},"_npmVersion":"7.21.1","description":"A plugin for elysia for server-side OAuth 2.0 Authorization Code Flow","directories":{},"_nodeVersion":"16.8.0","_hasShrinkwrap":false,"devDependencies":{"elysia":"^0.4.3","bun-types":"^0.5.8","typescript":"^5.0.3"},"peerDependencies":{"elysia":">= 0.4.3"},"_npmOperationalInternal":{"tmp":"tmp/elysia-oauth2_0.0.9_1680371965070_0.1429149438539925","host":"s3://npm-registry-packages"}},"0.0.10":{"name":"@bogeychan/elysia-oauth2","version":"0.0.10","keywords":["elysia","oauth2","bun"],"author":{"url":"https://github.com/bogeychan","name":"bogeychan","email":"bogeychan@outlook.com"},"license":"MIT","_id":"@bogeychan/elysia-oauth2@0.0.10","maintainers":[{"name":"bogeychan","email":"bogeychan@outlook.com"}],"homepage":"https://github.com/bogeychan/elysia-oauth2","bugs":{"url":"https://github.com/bogeychan/elysia-oauth2/issues"},"dist":{"shasum":"54d6197be636f2af8803e1b1238c4017502f4f20","tarball":"https://registry.npmjs.org/@bogeychan/elysia-oauth2/-/elysia-oauth2-0.0.10.tgz","fileCount":13,"integrity":"sha512-JbhE/JaLnafZ6YV31VoaA/sVvcbBovMjbqGhjlLfOYHUpUPyvllszL0L168njZoT4q1wbyyd3oei06cFomSOLQ==","signatures":[{"sig":"MEUCIA9ZGUfuOmcDBBbVsrs7PTmM/OF9/S8k+4Ov3Ry0EENQAiEAiHW/xU1j7fBtm08bYhGspiGSrgl0e7AILCiGPAhrSpY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25185},"main":"src/index.ts","type":"module","types":"src/index.ts","gitHead":"2a976ce22e354d3160bb9630a9af2fa5d1a44d2d","_npmUser":{"name":"bogeychan","email":"bogeychan@outlook.com"},"repository":{"url":"git+https://github.com/bogeychan/elysia-oauth2.git","type":"git"},"_npmVersion":"9.5.1","description":"A plugin for Elysia.js for server-side OAuth 2.0 Authorization Code Flow","directories":{},"_nodeVersion":"18.16.0","_hasShrinkwrap":false,"devDependencies":{"elysia":"^0.5.3","bun-types":"^0.6.3","typescript":"^5.0.4"},"peerDependencies":{"elysia":">= 0.5.3"},"_npmOperationalInternal":{"tmp":"tmp/elysia-oauth2_0.0.10_1684884660381_0.3124753062150585","host":"s3://npm-registry-packages"}},"0.0.11":{"name":"@bogeychan/elysia-oauth2","version":"0.0.11","keywords":["elysia","oauth2","bun"],"author":{"url":"https://github.com/bogeychan","name":"bogeychan","email":"bogeychan@outlook.com"},"license":"MIT","_id":"@bogeychan/elysia-oauth2@0.0.11","maintainers":[{"name":"bogeychan","email":"bogeychan@outlook.com"}],"homepage":"https://github.com/bogeychan/elysia-oauth2","bugs":{"url":"https://github.com/bogeychan/elysia-oauth2/issues"},"dist":{"shasum":"d93de1514c0ba65f9107be7e329feebef68c7ab4","tarball":"https://registry.npmjs.org/@bogeychan/elysia-oauth2/-/elysia-oauth2-0.0.11.tgz","fileCount":14,"integrity":"sha512-uJNBZ5O0zTNcic7Tm+U05ES7lVH4T+CLs6r6FQsmb4RJbOTCW8oPJf+pwVzvV7q2l7dLrQ0V8GaygPQwc1HFYQ==","signatures":[{"sig":"MEQCIEsn55cp+Ad8UmgxEB/8ZYK7b5Y0pE79qvL7oW0TjvTMAiBHJwJ80aRILgA9lJOKUNcCxh2DRMRc9CHCG5FtuVN1nA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25216},"main":"src/index.ts","type":"module","types":"src/index.ts","gitHead":"28f2320c0f24b0f7f76b7e6f54cdc8fa83f6ba5a","_npmUser":{"name":"bogeychan","email":"bogeychan@outlook.com"},"repository":{"url":"git+https://github.com/bogeychan/elysia-oauth2.git","type":"git"},"_npmVersion":"9.5.1","description":"A plugin for Elysia.js for server-side OAuth 2.0 Authorization Code Flow","directories":{},"_nodeVersion":"18.16.0","_hasShrinkwrap":false,"devDependencies":{"elysia":"^0.6.19","bun-types":"^1.0.1","typescript":"^5.2.2"},"peerDependencies":{"elysia":">= 0.6.19"},"_npmOperationalInternal":{"tmp":"tmp/elysia-oauth2_0.0.11_1694205309921_0.43796854582744027","host":"s3://npm-registry-packages"}},"0.0.12":{"name":"@bogeychan/elysia-oauth2","version":"0.0.12","keywords":["elysia","oauth2","bun"],"author":{"url":"https://github.com/bogeychan","name":"bogeychan","email":"bogeychan@outlook.com"},"license":"MIT","_id":"@bogeychan/elysia-oauth2@0.0.12","maintainers":[{"name":"bogeychan","email":"bogeychan@outlook.com"}],"homepage":"https://github.com/bogeychan/elysia-oauth2","bugs":{"url":"https://github.com/bogeychan/elysia-oauth2/issues"},"dist":{"shasum":"4bc08d0a109177ae0d5398f00978247e41feb14b","tarball":"https://registry.npmjs.org/@bogeychan/elysia-oauth2/-/elysia-oauth2-0.0.12.tgz","fileCount":14,"integrity":"sha512-T2E50s1q43AJ2e1DXHhv0TlelRyNiYJ4ylKzRYRxdW5AtclMvYvMxdMIxLdYSCeUu8lDG8ikcqE5ISinQG5vmw==","signatures":[{"sig":"MEUCIHWNq4vXh74I3AnQkUCPc4HhVxDj2A7GEs/JEV9KD+d3AiEAiEeh8o5hafwRNfoSFKUDOhQWqBv4De8HF/bWxfx0vA0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25353},"main":"src/index.ts","type":"module","types":"src/index.ts","gitHead":"e74ed3a7b708a33d3f2bff84a60dd2869f31bae2","_npmUser":{"name":"bogeychan","email":"bogeychan@outlook.com"},"repository":{"url":"git+https://github.com/bogeychan/elysia-oauth2.git","type":"git"},"_npmVersion":"9.5.1","description":"A plugin for Elysia.js for server-side OAuth 2.0 Authorization Code Flow","directories":{},"_nodeVersion":"18.16.0","_hasShrinkwrap":false,"devDependencies":{"elysia":"^0.6.19","bun-types":"^1.0.1","typescript":"^5.2.2"},"peerDependencies":{"elysia":">= 0.6.19"},"_npmOperationalInternal":{"tmp":"tmp/elysia-oauth2_0.0.12_1695079980448_0.7566056732061204","host":"s3://npm-registry-packages"}},"0.0.13":{"name":"@bogeychan/elysia-oauth2","version":"0.0.13","keywords":["elysia","oauth2","bun"],"author":{"url":"https://github.com/bogeychan","name":"bogeychan","email":"bogeychan@outlook.com"},"license":"MIT","_id":"@bogeychan/elysia-oauth2@0.0.13","maintainers":[{"name":"bogeychan","email":"bogeychan@outlook.com"}],"homepage":"https://github.com/bogeychan/elysia-oauth2","bugs":{"url":"https://github.com/bogeychan/elysia-oauth2/issues"},"dist":{"shasum":"5c9aca33cb3a97069f9aac4bd5be3948dda73dbd","tarball":"https://registry.npmjs.org/@bogeychan/elysia-oauth2/-/elysia-oauth2-0.0.13.tgz","fileCount":14,"integrity":"sha512-rfdCwgnuMNi2H1iAkoSOlXiD2meifYEEsLfDyyqQMwj07GUe+nwn+xLoD1UzoKqq0KZ/fkJRPpgf7asjqAO6NQ==","signatures":[{"sig":"MEQCIDV9MxVyaAgKW+hsC0jDjXTPVL5CW6WFogBeI+dBsZrgAiBExw7U3tBZ7Wkq3FzLTaEAbMC0BDgoK6SSulxWqPTqVA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25644},"main":"src/index.ts","type":"module","types":"src/index.ts","gitHead":"62104aa43b543ee33882ab86118bf2d14269ee47","_npmUser":{"name":"bogeychan","email":"bogeychan@outlook.com"},"repository":{"url":"git+https://github.com/bogeychan/elysia-oauth2.git","type":"git"},"_npmVersion":"9.5.1","description":"A plugin for Elysia.js for server-side OAuth 2.0 Authorization Code Flow","directories":{},"_nodeVersion":"18.16.0","_hasShrinkwrap":false,"devDependencies":{"elysia":"^0.7.12","bun-types":"^1.0.3","typescript":"^5.2.2"},"peerDependencies":{"elysia":">= 0.7.12"},"_npmOperationalInternal":{"tmp":"tmp/elysia-oauth2_0.0.13_1695579387699_0.4819834302621395","host":"s3://npm-registry-packages"}},"0.0.14":{"name":"@bogeychan/elysia-oauth2","version":"0.0.14","keywords":["elysia","oauth2","bun"],"author":{"url":"https://github.com/bogeychan","name":"bogeychan","email":"bogeychan@outlook.com"},"license":"MIT","_id":"@bogeychan/elysia-oauth2@0.0.14","maintainers":[{"name":"bogeychan","email":"bogeychan@outlook.com"}],"homepage":"https://github.com/bogeychan/elysia-oauth2","bugs":{"url":"https://github.com/bogeychan/elysia-oauth2/issues"},"dist":{"shasum":"d4b1514ff5df471efa01344723aabb28a078e19c","tarball":"https://registry.npmjs.org/@bogeychan/elysia-oauth2/-/elysia-oauth2-0.0.14.tgz","fileCount":14,"integrity":"sha512-JDT7vUtfiUEHeGziNTzcuMWQpS+Fjn4aniQeOjsYU/unq6vOOlHbqXER4de5DBPfMGRPERzse22uxPlnrCqXPA==","signatures":[{"sig":"MEYCIQDmrN3u0PDgNd0xMfjEpASGhFL2xBliLpzinCKJ9lqeYwIhALVXrMm4uc9e6DsoV0h9Rzt+oqL2DGbhMpG3oahaKpxY","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25874},"main":"src/index.ts","type":"module","types":"src/index.ts","gitHead":"09a0df13bd9df11f69707368ef0b10da3bace50e","_npmUser":{"name":"bogeychan","email":"bogeychan@outlook.com"},"repository":{"url":"git+https://github.com/bogeychan/elysia-oauth2.git","type":"git"},"_npmVersion":"9.5.1","description":"A plugin for Elysia.js for server-side OAuth 2.0 Authorization Code Flow","directories":{},"_nodeVersion":"18.16.0","_hasShrinkwrap":false,"devDependencies":{"elysia":"^0.7.12","bun-types":"^1.0.3","typescript":"^5.2.2"},"peerDependencies":{"elysia":">= 0.7.12"},"_npmOperationalInternal":{"tmp":"tmp/elysia-oauth2_0.0.14_1696285626395_0.36388698076113646","host":"s3://npm-registry-packages"}},"0.0.15":{"name":"@bogeychan/elysia-oauth2","version":"0.0.15","keywords":["elysia","oauth2","bun"],"author":{"url":"https://github.com/bogeychan","name":"bogeychan","email":"bogeychan@outlook.com"},"license":"MIT","_id":"@bogeychan/elysia-oauth2@0.0.15","maintainers":[{"name":"bogeychan","email":"bogeychan@outlook.com"}],"homepage":"https://github.com/bogeychan/elysia-oauth2","bugs":{"url":"https://github.com/bogeychan/elysia-oauth2/issues"},"dist":{"shasum":"b2d180001dc63fcd3ecb21d437dda2645d810d15","tarball":"https://registry.npmjs.org/@bogeychan/elysia-oauth2/-/elysia-oauth2-0.0.15.tgz","fileCount":15,"integrity":"sha512-0sUBhOIgl2Q4nLxNq4jRwiN0+jirO0mtGNb5qsL/KGn69RyqPM+hDGw6NQN++GVm8yg4U4gq/QWr5EPy5sEnVg==","signatures":[{"sig":"MEUCIQD7bxeQyHurIr8k2xu9i6955yXX98drUSWv8qnuWWN8HwIgaBVlVqFcHIToUUx8VWJ0V+Sa4UinnlE/deR/2e7Rh4E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":28141},"main":"src/index.ts","type":"module","types":"src/index.ts","gitHead":"7f97fb1bd6a176325151ec4d91d8c66525e21e1d","_npmUser":{"name":"bogeychan","email":"bogeychan@outlook.com"},"repository":{"url":"git+https://github.com/bogeychan/elysia-oauth2.git","type":"git"},"_npmVersion":"9.5.1","description":"A plugin for Elysia.js for server-side OAuth 2.0 Authorization Code Flow","directories":{},"_nodeVersion":"18.16.0","_hasShrinkwrap":false,"devDependencies":{"elysia":"^0.7.12","bun-types":"^1.0.3","typescript":"^5.2.2"},"peerDependencies":{"elysia":">= 0.7.12"},"_npmOperationalInternal":{"tmp":"tmp/elysia-oauth2_0.0.15_1696443750218_0.06628998799259023","host":"s3://npm-registry-packages"}},"0.0.16":{"name":"@bogeychan/elysia-oauth2","version":"0.0.16","keywords":["elysia","oauth2","bun"],"author":{"url":"https://github.com/bogeychan","name":"bogeychan","email":"bogeychan@outlook.com"},"license":"MIT","_id":"@bogeychan/elysia-oauth2@0.0.16","maintainers":[{"name":"bogeychan","email":"bogeychan@outlook.com"}],"homepage":"https://github.com/bogeychan/elysia-oauth2","bugs":{"url":"https://github.com/bogeychan/elysia-oauth2/issues"},"dist":{"shasum":"2803717d18d11d3b255e6e77fe7872126d233bdc","tarball":"https://registry.npmjs.org/@bogeychan/elysia-oauth2/-/elysia-oauth2-0.0.16.tgz","fileCount":14,"integrity":"sha512-4nKcXzL23Ocg/pqEvBThJ3UhE7GKgucwg1RMrajbqIWV99o0vB8O9dAJWenFlB+KEWM2776LaUi93mD9EgOm2g==","signatures":[{"sig":"MEUCIE7mKOW1wrF0Brze6cJLOdsXSyWnUT20Sn8PfIZWjSl7AiEAjj6ugJiq6kJMByY+aTociMP2j7ub5mXS3RCMdJYZbv8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":27182},"main":"src/index.ts","type":"module","types":"src/index.ts","gitHead":"15b9dc740be32986a98d0fb0ebd43a8ce70b6cde","_npmUser":{"name":"bogeychan","email":"bogeychan@outlook.com"},"repository":{"url":"git+https://github.com/bogeychan/elysia-oauth2.git","type":"git"},"_npmVersion":"9.5.1","description":"A plugin for Elysia.js for server-side OAuth 2.0 Authorization Code Flow","directories":{},"_nodeVersion":"18.16.0","_hasShrinkwrap":false,"devDependencies":{"elysia":"^0.7.12","bun-types":"^1.0.3","typescript":"^5.2.2"},"peerDependencies":{"elysia":">= 0.7.12"},"_npmOperationalInternal":{"tmp":"tmp/elysia-oauth2_0.0.16_1696589108928_0.23695118584240848","host":"s3://npm-registry-packages"}},"0.0.17":{"name":"@bogeychan/elysia-oauth2","version":"0.0.17","keywords":["elysia","oauth2","bun"],"author":{"url":"https://github.com/bogeychan","name":"bogeychan","email":"bogeychan@outlook.com"},"license":"MIT","_id":"@bogeychan/elysia-oauth2@0.0.17","maintainers":[{"name":"bogeychan","email":"bogeychan@outlook.com"}],"homepage":"https://github.com/bogeychan/elysia-oauth2","bugs":{"url":"https://github.com/bogeychan/elysia-oauth2/issues"},"dist":{"shasum":"4e13f06099a58d1343bf97bed0e7bda328d8539d","tarball":"https://registry.npmjs.org/@bogeychan/elysia-oauth2/-/elysia-oauth2-0.0.17.tgz","fileCount":14,"integrity":"sha512-rMCar7DrDn19IVHljP+d6zGpYr68gDbEbUmKdlDbA+EwqCbVQDDvUCQluw8ZykJzjMkTgJtkC4J7883H4wP8Wg==","signatures":[{"sig":"MEYCIQD7lMsdnphw+C2Z/YEu3DCOfUU2DAu8wxi31smUWwGTeAIhAJE59lc8P00FnOD999Ko6dGNvD4l++O84Dy45pGp0i2T","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":27000},"main":"src/index.ts","type":"module","types":"src/index.ts","gitHead":"c10d1cd83dbe1c074d82c7ed60b928cc1a6495e9","_npmUser":{"name":"bogeychan","email":"bogeychan@outlook.com"},"repository":{"url":"git+https://github.com/bogeychan/elysia-oauth2.git","type":"git"},"_npmVersion":"9.5.1","description":"A plugin for Elysia.js for server-side OAuth 2.0 Authorization Code Flow","directories":{},"_nodeVersion":"18.16.0","_hasShrinkwrap":false,"devDependencies":{"elysia":"^0.7.12","bun-types":"^1.0.3","typescript":"^5.2.2"},"peerDependencies":{"elysia":">= 0.7.12"},"_npmOperationalInternal":{"tmp":"tmp/elysia-oauth2_0.0.17_1701277609526_0.6627533611411269","host":"s3://npm-registry-packages"}},"0.0.18":{"name":"@bogeychan/elysia-oauth2","version":"0.0.18","keywords":["elysia","oauth2","bun"],"author":{"url":"https://github.com/bogeychan","name":"bogeychan","email":"bogeychan@outlook.com"},"license":"MIT","_id":"@bogeychan/elysia-oauth2@0.0.18","maintainers":[{"name":"bogeychan","email":"bogeychan@outlook.com"}],"homepage":"https://github.com/bogeychan/elysia-oauth2","bugs":{"url":"https://github.com/bogeychan/elysia-oauth2/issues"},"dist":{"shasum":"51f08fbd97367fc77e4813c135097f8110ce1476","tarball":"https://registry.npmjs.org/@bogeychan/elysia-oauth2/-/elysia-oauth2-0.0.18.tgz","fileCount":14,"integrity":"sha512-W1jzKsxFsB8R5rh3/wj86r05vy6MABV4rLnULZNRS2+GYocozYXQELxtDpArmrE9BpY+UklJV8gNA+4Kg1EG/w==","signatures":[{"sig":"MEUCICRGbL4wqAvXe1z7WBUpuYyAypu7MR8GgG93f+CFL0jAAiEAlWQqZHSGIS1kDhFf6Fy4dxBB1vtqMGpygFsTo3vYmq8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":27015},"main":"src/index.ts","type":"module","types":"src/index.ts","gitHead":"9f827dc0547712229e6ecae00991ab003e50bebf","_npmUser":{"name":"bogeychan","email":"bogeychan@outlook.com"},"repository":{"url":"git+https://github.com/bogeychan/elysia-oauth2.git","type":"git"},"_npmVersion":"10.2.5","description":"A plugin for Elysia.js for server-side OAuth 2.0 Authorization Code Flow","directories":{},"_nodeVersion":"20.10.0","_hasShrinkwrap":false,"devDependencies":{"elysia":"^0.8.3","bun-types":"1","typescript":"5"},"peerDependencies":{"elysia":">= 0.8.3"},"_npmOperationalInternal":{"tmp":"tmp/elysia-oauth2_0.0.18_1703429007099_0.3853524452286703","host":"s3://npm-registry-packages"}},"0.0.19":{"name":"@bogeychan/elysia-oauth2","version":"0.0.19","keywords":["elysia","oauth2","bun"],"author":{"url":"https://github.com/bogeychan","name":"bogeychan","email":"bogeychan@outlook.com"},"license":"MIT","_id":"@bogeychan/elysia-oauth2@0.0.19","maintainers":[{"name":"bogeychan","email":"bogeychan@outlook.com"}],"homepage":"https://github.com/bogeychan/elysia-oauth2","bugs":{"url":"https://github.com/bogeychan/elysia-oauth2/issues"},"dist":{"shasum":"afe8336fce0dced95cb39ce796f17f226312356a","tarball":"https://registry.npmjs.org/@bogeychan/elysia-oauth2/-/elysia-oauth2-0.0.19.tgz","fileCount":14,"integrity":"sha512-3Z7SxOEPdS4II39NvsHhL7gkmcyYhkV1Bh65pdwyDmsTG2zDyaw0/9375X4RpCQ2lNLM4NfjC7R6xQdK7Lirlg==","signatures":[{"sig":"MEYCIQDrivkV21mZolHGjzKiORBxjZ+e3pix3WJ27meEeSQ4RwIhAJ1rc0bkCZepLYc5AV9iz/xBTn7akKoMqMyobQH+9iDe","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":27031},"main":"src/index.ts","type":"module","types":"src/index.ts","gitHead":"3459cee592085be5ea400d345c47970d4e022b8e","_npmUser":{"name":"bogeychan","email":"bogeychan@outlook.com"},"repository":{"url":"git+https://github.com/bogeychan/elysia-oauth2.git","type":"git"},"_npmVersion":"10.2.5","description":"A plugin for Elysia.js for server-side OAuth 2.0 Authorization Code Flow","directories":{},"_nodeVersion":"20.10.0","_hasShrinkwrap":false,"devDependencies":{"elysia":"^0.8.8","bun-types":"1","typescript":"5"},"peerDependencies":{"elysia":">= 0.8.8"},"_npmOperationalInternal":{"tmp":"tmp/elysia-oauth2_0.0.19_1704767293789_0.5032470853725033","host":"s3://npm-registry-packages"}},"0.0.20":{"name":"@bogeychan/elysia-oauth2","version":"0.0.20","keywords":["elysia","oauth2","bun"],"author":{"url":"https://github.com/bogeychan","name":"bogeychan","email":"bogeychan@outlook.com"},"license":"MIT","_id":"@bogeychan/elysia-oauth2@0.0.20","maintainers":[{"name":"bogeychan","email":"bogeychan@outlook.com"}],"homepage":"https://github.com/bogeychan/elysia-oauth2","bugs":{"url":"https://github.com/bogeychan/elysia-oauth2/issues"},"dist":{"shasum":"ef0bbdfdfdf03a52886c078a999b6b29c33655e9","tarball":"https://registry.npmjs.org/@bogeychan/elysia-oauth2/-/elysia-oauth2-0.0.20.tgz","fileCount":14,"integrity":"sha512-w7zesWNTySjTQOX59SLgj9nj7akBY1OfmjE5laT6cWysDInybubGaOju6dUoJVnqbr0K0JDluyXSHH5SPNCd6w==","signatures":[{"sig":"MEYCIQC2FTrvBIWzF1Lgx69bOW1CqPX6ie55JsjWXndk+WMTewIhAP48jJprV/KpgvLQGtS/PSyQxdVHh8mUiCNajgpwY/xb","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":27053},"main":"src/index.ts","type":"module","types":"src/index.ts","gitHead":"9c83583c99c2b868faa6438dda2218a326ffe0da","_npmUser":{"name":"bogeychan","email":"bogeychan@outlook.com"},"repository":{"url":"git+https://github.com/bogeychan/elysia-oauth2.git","type":"git"},"_npmVersion":"10.2.5","description":"A plugin for Elysia.js for server-side OAuth 2.0 Authorization Code Flow","directories":{},"_nodeVersion":"20.10.0","_hasShrinkwrap":false,"devDependencies":{"elysia":"^1.0.3","@types/bun":"1","typescript":"5"},"peerDependencies":{"elysia":">= 1.0.3"},"_npmOperationalInternal":{"tmp":"tmp/elysia-oauth2_0.0.20_1710771255700_0.4413518357821462","host":"s3://npm-registry-packages"}},"0.0.21":{"name":"@bogeychan/elysia-oauth2","version":"0.0.21","keywords":["elysia","oauth2","bun"],"author":{"url":"https://github.com/bogeychan","name":"bogeychan","email":"bogeychan@outlook.com"},"license":"MIT","_id":"@bogeychan/elysia-oauth2@0.0.21","maintainers":[{"name":"bogeychan","email":"bogeychan@outlook.com"}],"homepage":"https://github.com/bogeychan/elysia-oauth2","bugs":{"url":"https://github.com/bogeychan/elysia-oauth2/issues"},"dist":{"shasum":"4bde2db43c282d682ce3882d4e15d8040fb5c183","tarball":"https://registry.npmjs.org/@bogeychan/elysia-oauth2/-/elysia-oauth2-0.0.21.tgz","fileCount":14,"integrity":"sha512-+TgBL7OylqER865D0f7DLD9nFc9rCFg0KNUwjQcbVt3HCn0itLyNypjet72oYdAyKkGFz/wlrLs+iEIxQVLRiQ==","signatures":[{"sig":"MEUCIHvRi0SVzmSkJS/BFsW1b9IV+2uhm/ksHMh2mbwWfEOuAiEA+7K/koaYKNh2EzdQ7dGfmu2ECZFDUSnIUt75IMhLTZM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":27224},"main":"src/index.ts","type":"module","types":"src/index.ts","gitHead":"8229e32c6d9ab6cb4b28391cc6c174d1180e2b5e","_npmUser":{"name":"bogeychan","email":"bogeychan@outlook.com"},"repository":{"url":"git+https://github.com/bogeychan/elysia-oauth2.git","type":"git"},"_npmVersion":"10.2.5","description":"A plugin for Elysia.js for server-side OAuth 2.0 Authorization Code Flow","directories":{},"_nodeVersion":"20.10.0","_hasShrinkwrap":false,"devDependencies":{"elysia":"^1.0.22","@types/bun":"1","typescript":"5"},"peerDependencies":{"elysia":">= 1.0.22"},"_npmOperationalInternal":{"tmp":"tmp/elysia-oauth2_0.0.21_1716556990420_0.529772462451114","host":"s3://npm-registry-packages"}},"0.0.22":{"name":"@bogeychan/elysia-oauth2","version":"0.0.22","keywords":["elysia","oauth2","bun"],"author":{"url":"https://github.com/bogeychan","name":"bogeychan","email":"bogeychan@outlook.com"},"license":"MIT","_id":"@bogeychan/elysia-oauth2@0.0.22","maintainers":[{"name":"bogeychan","email":"bogeychan@outlook.com"}],"homepage":"https://github.com/bogeychan/elysia-oauth2","bugs":{"url":"https://github.com/bogeychan/elysia-oauth2/issues"},"dist":{"shasum":"5709cf1812e482dc62ada6eccf14e80f6c7ace3e","tarball":"https://registry.npmjs.org/@bogeychan/elysia-oauth2/-/elysia-oauth2-0.0.22.tgz","fileCount":14,"integrity":"sha512-UXzYueDzCdwdacpF+NhV81NmJrM6isEnrJlTJNNfns1sXvDhDr3tERd6UBnUT5v6zHq+XBvXQFZeSvBbNp+W+Q==","signatures":[{"sig":"MEQCIGhz71+tgLTFCbbsstJkFOw/dHXjPqw76QQsPR9aa18SAiBSSJ9OwHsogGAW/X6K97vKGuM6nZhOCYBqn4BOHIE42Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":27242},"main":"src/index.ts","type":"module","types":"src/index.ts","gitHead":"308030aea04c3eecde6e5f1ab15c2a91b254fd6e","_npmUser":{"name":"bogeychan","email":"bogeychan@outlook.com"},"repository":{"url":"git+https://github.com/bogeychan/elysia-oauth2.git","type":"git"},"_npmVersion":"10.2.5","description":"A plugin for Elysia.js for server-side OAuth 2.0 Authorization Code Flow","directories":{},"_nodeVersion":"20.10.0","_hasShrinkwrap":false,"devDependencies":{"elysia":"^1.1.0","@types/bun":"1","typescript":"5"},"peerDependencies":{"elysia":">= 1.1.0"},"_npmOperationalInternal":{"tmp":"tmp/elysia-oauth2_0.0.22_1721148997261_0.003382036265626942","host":"s3://npm-registry-packages"}},"0.1.0":{"name":"@bogeychan/elysia-oauth2","version":"0.1.0","description":"A plugin for Elysia.js for server-side OAuth 2.0 Authorization Code Flow","author":{"name":"bogeychan","email":"bogeychan@outlook.com","url":"https://github.com/bogeychan"},"repository":{"type":"git","url":"git+https://github.com/bogeychan/elysia-oauth2.git"},"type":"module","main":"src/index.ts","types":"src/index.ts","scripts":{"test":"bun run test:types && bun test","test:types":"tsc","release":"bun run test && npm publish --access public"},"devDependencies":{"@types/bun":"^1.2.2","elysia":"^1.2.12","typescript":"^5.7.3"},"peerDependencies":{"elysia":">= 1.2.12"},"homepage":"https://github.com/bogeychan/elysia-oauth2","bugs":{"url":"https://github.com/bogeychan/elysia-oauth2/issues"},"license":"MIT","keywords":["elysia","oauth2","bun"],"_id":"@bogeychan/elysia-oauth2@0.1.0","gitHead":"488d3519c5a3c5227fef8a1607d6455925c3b7b3","_nodeVersion":"22.13.1","_npmVersion":"10.9.2","dist":{"integrity":"sha512-VEwuJYuEYYO4FHMeqhpoQz0Gj/kMhL1kL2aHl2vRkSxfSFTBxqCOD1yXH/yIeKYyYhLSWiN73eoPskcO12n9hQ==","shasum":"61ff08b02e889b7d460b0c6e85eb9c11d914ee74","tarball":"https://registry.npmjs.org/@bogeychan/elysia-oauth2/-/elysia-oauth2-0.1.0.tgz","fileCount":15,"unpackedSize":30368,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQD3UpAj47plUar1FItqPeIBfyUiXQATW65hsveS9W5tUgIgMfmXZKMfpuS8Vc6NUWlYBAVo8NwNiJxpiUY2qKyzlaQ="}]},"_npmUser":{"name":"bogeychan","email":"bogeychan@outlook.com"},"directories":{},"maintainers":[{"name":"bogeychan","email":"bogeychan@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/elysia-oauth2_0.1.0_1739304561624_0.01991636862571422"},"_hasShrinkwrap":false}},"time":{"created":"2022-12-25T03:51:46.538Z","modified":"2025-02-11T20:09:22.002Z","0.0.7":"2022-12-25T03:51:46.756Z","0.0.8":"2023-02-09T22:13:15.351Z","0.0.9":"2023-04-01T17:59:25.280Z","0.0.10":"2023-05-23T23:31:00.576Z","0.0.11":"2023-09-08T20:35:10.058Z","0.0.12":"2023-09-18T23:33:00.598Z","0.0.13":"2023-09-24T18:16:27.885Z","0.0.14":"2023-10-02T22:27:06.725Z","0.0.15":"2023-10-04T18:22:30.408Z","0.0.16":"2023-10-06T10:45:09.097Z","0.0.17":"2023-11-29T17:06:49.745Z","0.0.18":"2023-12-24T14:43:27.308Z","0.0.19":"2024-01-09T02:28:14.041Z","0.0.20":"2024-03-18T14:14:15.941Z","0.0.21":"2024-05-24T13:23:10.594Z","0.0.22":"2024-07-16T16:56:37.424Z","0.1.0":"2025-02-11T20:09:21.811Z"},"bugs":{"url":"https://github.com/bogeychan/elysia-oauth2/issues"},"author":{"name":"bogeychan","email":"bogeychan@outlook.com","url":"https://github.com/bogeychan"},"license":"MIT","homepage":"https://github.com/bogeychan/elysia-oauth2","keywords":["elysia","oauth2","bun"],"repository":{"type":"git","url":"git+https://github.com/bogeychan/elysia-oauth2.git"},"description":"A plugin for Elysia.js for server-side OAuth 2.0 Authorization Code Flow","maintainers":[{"name":"bogeychan","email":"bogeychan@outlook.com"}],"readme":"# @bogeychan/elysia-oauth2\n\nA plugin for [Elysia.js](https://elysiajs.com) for server-side [OAuth 2.0 Authorization Code Flow](https://www.oauth.com/oauth2-servers/server-side-apps/authorization-code)\n\n## [Migration guide](./MIGRATION.md)\n\n## Installation\n\n```bash\nbun add @bogeychan/elysia-oauth2\n```\n\n## Usage\n\n```ts\nimport { Elysia } from 'elysia'\nimport oauth2, { github } from '@bogeychan/elysia-oauth2'\n\nimport { randomBytes } from 'crypto'\n\nconst globalState = randomBytes(8).toString('hex')\nlet globalToken = null\n\nconst app = new Elysia()\n\nconst auth = oauth2({\n\tprofiles: {\n\t\t// define multiple OAuth 2.0 profiles\n\t\tgithub: {\n\t\t\tprovider: github(),\n\t\t\tscope: ['user']\n\t\t}\n\t},\n\tstate: {\n\t\t// custom state verification between requests\n\t\tcheck(ctx, name, state) {\n\t\t\treturn state === globalState\n\t\t},\n\t\tgenerate(ctx, name) {\n\t\t\treturn globalState\n\t\t}\n\t},\n\tstorage: {\n\t\t// storage of users' access tokens is up to you\n\t\tget(ctx, name) {\n\t\t\treturn globalToken\n\t\t},\n\t\tset(ctx, name, token) {\n\t\t\tglobalToken = token\n\t\t},\n\t\tdelete(ctx, name) {\n\t\t\tglobalToken = null\n\t\t}\n\t}\n})\n\nfunction userPage(user: {}, logout: string) {\n\tconst html = `<!DOCTYPE html>\n    <html lang=\"en\">\n    <body>\n      User:\n      <pre>${JSON.stringify(user, null, '\\t')}</pre>\n      <a href=\"${logout}\">Logout</a>\n    </body>\n    </html>`\n\n\treturn new Response(html, { headers: { 'Content-Type': 'text/html' } })\n}\n\napp\n\t.use(auth)\n\t.get('/', async (ctx) => {\n\t\t// get login, callback, logout urls for one or more OAuth 2.0 profiles\n\t\tconst profiles = ctx.profiles('github')\n\n\t\t// check if one or more OAuth 2.0 profiles are authorized\n\t\tif (await ctx.authorized('github')) {\n\t\t\tconst user = await fetch('https://api.github.com/user', {\n\t\t\t\t// ... and use the Authorization header afterwards\n\t\t\t\theaders: await ctx.tokenHeaders('github')\n\t\t\t})\n\n\t\t\treturn userPage(await user.json(), profiles.github.logout)\n\t\t}\n\n\t\t// Render login page\n\t\tconst html = `<!DOCTYPE html>\n    <html lang=\"en\">\n    <body>\n      <h2>Login with <a href=\"${profiles.github.login}\">Github</a></h2>\n    </body>\n    </html>`\n\n\t\treturn new Response(html, { headers: { 'Content-Type': 'text/html' } })\n\t})\n\t.listen(3000)\n\nconsole.log('Listening on http://localhost:3000')\n```\n\n## Where are the client credentials?\n\n1. Generate a `client id` and `client secret` for an [OAuth app on Github](https://docs.github.com/en/developers/apps/building-oauth-apps/creating-an-oauth-app)\n2. Use `http://localhost:3000/login/github/authorized` as your `Authorization callback URL`\n3. Create an `.env` file based on the previously generated client credentials:\n\n   ```env\n   GITHUB_OAUTH_CLIENT_ID=client id\n   GITHUB_OAUTH_CLIENT_SECRET=client secret\n   ```\n\n4. [Bun](https://bun.sh/docs/runtime/env) automatically loads environment variables from `.env` files\n\nIf you are unsure which URL should be used as `Authorization callback URL` call `ctx.profiles()` without an argument to get all URLs of all registered OAuth 2.0 Profiles:\n\n```ts\napp\n\t.use(auth)\n\t.get('/', (ctx) => {\n\t\treturn ctx.profiles()\n\t})\n\t.listen(3000)\n```\n\n## Use custom plugins in `Storage` and `State`\n\n```ts\nimport oauth2, {\n\tgithub,\n\ttype InferContext,\n\ttype TOAuth2AccessToken\n} from '@bogeychan/elysia-oauth2'\n\nconst mySessionPLugin = new Elysia().derive((ctx) => ({\n\tsession: {\n\t\tgetOAuthToken(name: string): TOAuth2AccessToken {\n\t\t\tconst sessionId = ctx.cookie['session-id'].value\n\t\t\treturn // TODO\n\t\t},\n\t\tsetOAuthToken(name: string, token: TOAuth2AccessToken) {\n\t\t\t// TODO\n\t\t},\n\t\tdeleteOAuthToken(name: string) {\n\t\t\t// TODO\n\t\t}\n\t}\n}))\n\nconst app = new Elysia().use(mySessionPLugin)\n\nconst auth = oauth2({\n\tprofiles: {\n\t\tgithub: {\n\t\t\tprovider: github(),\n\t\t\tscope: ['user']\n\t\t}\n\t},\n\tstate: {\n\t\tcheck(ctx, name, state) {\n\t\t\treturn state === globalState\n\t\t},\n\t\tgenerate(ctx, name) {\n\t\t\treturn globalState\n\t\t}\n\t},\n\tstorage: {\n\t\tget(ctx: InferContext<typeof app>, name) {\n\t\t\treturn ctx.session.getOAuthToken(name)\n\t\t},\n\t\tset(ctx: InferContext<typeof app>, name, token) {\n\t\t\tctx.session.setOAuthToken(name, token)\n\t\t},\n\t\tdelete(ctx: InferContext<typeof app>, name) {\n\t\t\tctx.session.deleteOAuthToken(name)\n\t\t}\n\t}\n})\n```\n\n## Use predefined OAuth 2.0 providers\n\n```ts\nimport { azure, discord, github, ... } from '@bogeychan/elysia-oauth2';\n```\n\n- All available providers are listed inside the [providers](./src/providers) folder.\n\n- Checkout the [examples](./examples) folder on github for further use cases such as the [Bun's sqlite module](https://bun.sh/docs/api/sqlite).\n\n## Define your own OAuth 2.0 provider\n\n```ts\nimport oauth2, { TOAuth2Provider } from '@bogeychan/elysia-oauth2'\n\nfunction myGithub(): TOAuth2Provider {\n\treturn {\n\t\tclientId: 'YOUR_CLIENT_ID',\n\t\tclientSecret: 'YOUR_CLIENT_SECRET',\n\n\t\tauth: {\n\t\t\turl: 'https://github.com/login/oauth/authorize',\n\t\t\tparams: {\n\t\t\t\tallow_signup: true\n\t\t\t}\n\t\t},\n\n\t\ttoken: {\n\t\t\turl: 'https://github.com/login/oauth/access_token',\n\t\t\tparams: {}\n\t\t}\n\t}\n}\n\nconst auth = oauth2({\n\tprofiles: {\n\t\tgithub: {\n\t\t\tprovider: myGithub(),\n\t\t\tscope: ['user']\n\t\t}\n\t}\n\t// ...\n})\n```\n\n## License\n\n[MIT](LICENSE)\n","readmeFilename":"README.md"}