Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make current_user available in jinja templates #478

Closed
ghost opened this issue May 22, 2022 · 2 comments
Closed

make current_user available in jinja templates #478

ghost opened this issue May 22, 2022 · 2 comments

Comments

@ghost
Copy link

ghost commented May 22, 2022

Can jinja templates get current_user variable access without passing it explicitly? Like Flask-Login does, its quite convinient

@vimalloc
Copy link
Owner

vimalloc commented Jun 1, 2022

Seems totally reasonable to me! I'll look into seeing what that entails when I have some time!

@vimalloc
Copy link
Owner

I added a configuration option to allow this. I did not turn it on by default because it's conceivable it would be a breaking change. Once I get another release pushed out you can turn it on like this:

JWTManager(app, add_context_processor=True)

or

jwt.init_app(app, add_context_processor=True)

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant