GibbsConsulting / django-plotly-dash

Expose plotly dash apps as django tags
MIT License
548 stars 124 forks source link

view decorator not redirecting AnonymousUser to login #285

Open hungpl2 opened 3 years ago

hungpl2 commented 3 years ago

PLOTLY_DASH = { 'serve_locally': False, "view_decorator": "django_plotly_dash.access.login_required", }

if the user is logged out of the Django session and they continue to use an open dash app (trigger callbacks through dash_update_component) and the dash app has the access.login_required decorator as the "views_decorator" is there a way to redirect the user and force them to go through the login flow? Currently it is not occurring and we are seeing failed attempts to redirect:

Access to fetch at '' (redirected from '/_dash-update-component') from origin ' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

GibbsConsulting commented 3 years ago

@hungpl2 does your application successfully redirect from other (non django-plotly-dash) pages? And is login_oauth on the same server or a different one?