In crate::auth::auth, we have the register_fosscord and login_fosscord methods. They do almost the exact same thing, which is send a POST request with a json body to an API route, handling any errors that may occur on the way and return an outcome. This code could very easily be put into one method, which would make it re-usable and remove code duplicates :)
In crate::auth::auth, we have the register_fosscord and login_fosscord methods. They do almost the exact same thing, which is send a POST request with a json body to an API route, handling any errors that may occur on the way and return an outcome. This code could very easily be put into one method, which would make it re-usable and remove code duplicates :)