nexus_callback is the equivalent of ‘page-1’ in my original example.
‘nexus_callback’ is calling the ‘layout function’ from nexus_layout.
current_user
was originally in ‘nexus_layout’.
I also tried moving it into ‘nexus_callback’, but the error remained.
from . import nexus_layout as page_layout
from flask_login import current_user
from dash import dcc, html
if not current_user.is_authenticated:
layout = html.Div([dcc.Link("login", href="/login"), " to continue"])
else:
layout = page_layout.layout()