Closed joshfriend closed 3 years ago
Thanks!
as it turns out, while this was a step in the right direction, using the identity_handler
as a decorator as shown above and in the README example still does not work for late-init apps because ca.init_app(app)
sets the callback to None
again unless you pass the callback to init_app
:
ca = CognitoAuth()
def handler(payload):
return none
app = Flask()
ca.init_app(app, identity_handler=handler)
WIth the following basic app sample, the error
AttributeError: 'CognitoAuth' object has no attribute 'identity_callback'
is thrown when trying to register an identity handler:This PR ensures that the
identity_callback
property that is being checked exists when registering an identity handler, because it currently does not untilinit_app
is called.