Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions dash_auth/current_user_hook/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import flask

from dash import hooks

@hooks.custom_data("user")
def custom_data_func(_ctx):
try:
cu = flask.session["user"]
except AttributeError as e:
cu = {}
return cu
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
},
python_requires=">=3.8",
include_package_data=True,
entrypoints={"dash_hooks": ["current_user_hook = current_user_hook"]},
url='https://plotly.com/dash',
classifiers=[
'Development Status :: 5 - Production/Stable',
Expand Down