Sumit-adeppa/spring-security-oauth2-resource-server ? reverse-engineered prompt
Reverse engineered prompt
Build me a stateless Spring Boot REST API for user sign up and login with solid security built in.
I want people to be able to register with a username, email, and password, then verify their email with a 6 digit OTP sent by email before the account is active. After that, let them log in with email and password and get a short lived JWT access token signed with RSA. The API should protect routes based on roles, with normal users and admins, and include an admin only endpoint to list users. It should also block repeated bad login attempts by IP and by account, and revoke the current token when the user logs out so it can’t be used again.
Please include MySQL storage, database migrations, clean validation, and helpful JSON error responses. Make it feel production ready, with Spring Security, Actuator health, and tests. If you need anything unclear, look up the current docs online and use sensible defaults.
Are you gonna build this?
make sure you review the code using coderabbit