timelessnesses/tlns-google-oauth2 ? reverse-engineered prompt

Reverse engineered prompt

Build me a Rust library for server side Google OAuth2 login with type safe scopes.

I want a clean way to create a Google auth client with client id, client secret, and callback URL, then generate the sign in URL, get the CSRF token, and exchange the callback code for an access token. Please include built in scope enums so I can pick scopes in a safe way instead of typing strings everywhere, and make it easy to mix custom scope types too if they implement the right trait.

Also add the proc macro part that can generate the scope enums from a pasted Google scopes list, since that is part of the project idea. If there’s an example app, show the full flow from building the auth URL to handling the callback and fetching the token. Look up current docs online if you need to, but keep the API simple and pleasant to use.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab