Difficulty: 5/10JWT verification, middleware, token revocationjavascriptCopyScenario Questions0-2 years experience1How would you implement a middleware in Express that checks the Authorization header for a JWT and returns 401 if it's missing or invalid?2What happens if the token signature verification fails? How would your code respond?3If a client sends a token that is expired, how would you detect that and what response would you send?Follow-up QuestionsHow would you test that your middleware correctly rejects invalid tokens?What security considerations would you keep in mind when storing the signing secret?Can you explain how you would expose metrics for token verification failures?Suggest Improvement