Difficulty: 5/10Next.js API Routes, JWT Authentication, Token SecurityjavascriptCopyScenario Questions0-2 years experience1Imagine we are building a simple login endpoint in Next.js. How would you write a Route Handler that takes a username and password, verifies them, and signs a JWT with a 15-minute expiration using an environment variable for the secret?2If you accidentally hardcoded the JWT secret key in your Next.js API route file instead of using `process.env`, what are the security risks, and how does Next.js prevent or expose this during a production build?2-5 years experienceFollow-up QuestionsHow would you handle token revocation if a user's password is changed?Why might you choose the `jose` library over `jsonwebtoken` in a Next.js Edge runtime environment?What are the security implications of storing this JWT in localStorage versus an httpOnly cookie?Suggest Improvement