Auto-generated tile from GitHub (10 skills)
92
94%
Does it follow best practices?
Impact
92%
1.16xAverage score across 44 eval scenarios
Advisory
Suggest reviewing before use
A mid-sized SaaS company is adding single sign-on to their customer portal, which is a Fastify-based web application. The company already has an authorization server running at https://auth.example.com (supporting OpenID Connect), and the portal is deployed at https://portal.example.com. The engineering team wants users to be able to click a login button, be redirected to the authorization server, grant consent, and land back in the portal authenticated with an access token and refresh token stored safely.
The portal is a server-rendered app — the frontend is not a standalone SPA. The auth server credentials (client ID and secret) are available as environment variables CLIENT_ID, CLIENT_SECRET, and the full callback URL is in CALLBACK_URI. The auth server base URL is in AUTH_SERVER.
Implement the following files for a TypeScript Fastify project:
plugins/oauth.ts — the OAuth2 plugin registrationroutes/auth.ts — the callback handler and logout routeThe implementation should be production-ready, handle the full authorization flow, and follow current security best practices for server-side web applications.
Do NOT include environment variable values in the code — read them from process.env.
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10
scenario-11
scenario-12
scenario-13
scenario-14
scenario-15
scenario-16
scenario-17
scenario-18
scenario-19
scenario-20
scenario-21
scenario-22
scenario-23
scenario-24
scenario-25
scenario-26
scenario-27
scenario-28
scenario-29
scenario-30
scenario-31
scenario-32
scenario-33
scenario-34
scenario-35
scenario-36
scenario-37
scenario-38
scenario-39
scenario-40
scenario-41
scenario-42
scenario-43
scenario-44
skills
documentation
fastify
init
linting-neostandard-eslint9
node
nodejs-core
rules
oauth
octocat
snipgrapher