dxps / fullstack-rust-axum-dioxus-rwa

A RealWorld app implementation as a fullstack Rust project using Axum (back-end) and Dioxus (front-end).
MIT License
80 stars 6 forks source link

[be] Consistenly use `UserId` extractor, instead of `Claims` #15

Closed dxps closed 1 year ago

dxps commented 1 year ago

follow_user and create_article handlers are using user_claims: Claims as method arguments. But they are using only user_claims.sub part which is actually the UserId. Therefore, it's more clear and efficient to use user_id: UserId extractor.

And update_article and delete_article handlers are not using any of these, so they behave as public (not protected as they should be) endpoints.