You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’d love to see the possibly of simply sub-classing JWTManager and overwriting methods instead of defining callbacks using decorators. Currently it’s not possible to do that because the default callbacks are set in JWTManager.__init__() and thereby can only be overwritten after the manager has been instantiated.
Is there an advantage of registering the callbacks using decorators or is this just syntactic-sugar?
The text was updated successfully, but these errors were encountered:
The reason we went with decorators instead of a more OOP approach was because that is the way most familiar for developers to interact with core flask and a bunch of existing flask add-ons, at least at the time this library was written. There is nothing wrong with an OOP way, it just isn't as common as decorators when dealing with flask code.
You could do an OOP approach do this right now, although it is a little funky because you have to dig into some private variables and use a static method for the callback:
I’d love to see the possibly of simply sub-classing
JWTManager
and overwriting methods instead of defining callbacks using decorators. Currently it’s not possible to do that because the default callbacks are set inJWTManager.__init__()
and thereby can only be overwritten after the manager has been instantiated.Is there an advantage of registering the callbacks using decorators or is this just syntactic-sugar?
The text was updated successfully, but these errors were encountered: