mblackgeo / flask-cognito-lib

A Flask extension that supports protecting routes with AWS Cognito following OAuth 2.1 best practices
https://mblackgeo.github.io/flask-cognito-lib/
MIT License
59 stars 18 forks source link

feat: decorator use config from app context #42

Closed lokeoke closed 6 months ago

lokeoke commented 7 months ago

Currently https://github.com/mblackgeo/flask-cognito-lib/blob/main/src/flask_cognito_lib/decorators.py#L21 instantiates a new Config() instead of using one from the app context. This results in an issue where user wants to override the Config class but it only applies to https://github.com/mblackgeo/flask-cognito-lib/blob/main/src/flask_cognito_lib/plugin.py.

In my specific use-case instead of using AWS_COGNITO_REDIRECT_URL and AWS_COGNITO_LOGOUT_URL I want to generate them using url_for(e.g. return url_for(endpoint='auth.cognito', _external=True)) and it isn't possible due to the issue.

mblackgeo commented 6 months ago

Closed by #43