IndominusByte / fastapi-jwt-auth

FastAPI extension that provides JWT Auth support (secure, easy to use, and lightweight)
http://indominusbyte.github.io/fastapi-jwt-auth/
MIT License
627 stars 143 forks source link

AuthConfig.load_config decorator decision #58

Open WiseDemon opened 3 years ago

WiseDemon commented 3 years ago

Hello, i was looking at Basic Usage example, and saw, that AuthJWT uses inherited from AuthConfig decorator to set it's static variables. However, this decorator does not return anything, so it "eat's up" decorated function.

I'm not a very experienced Python user, so i haven't even tought of such decorator usage (and i don't know how to google examples of that usage properly, other than "python using decorator without return"). I was wondering if someone can explain, why config is loaded that way and not, for example, using a method that just takes settings instance as an argument, and why decorator doesn't return that function back. What are advantages and purpose of that method?

Thanks in advance.