SolaraS
Solara2y ago
conic

Help: Auth Redirect to a new page

I'd like for my application to start on the auth0 login url rather than a solara page if the user is not authenticated.

The example for solara auth involves a Button redirect to the login_url
@solara.component
def Page():
    if not auth.user.value:
        solara.Button("Login", icon_name="mdi-login", href=auth.get_login_url())


I'm looking for a redirect function without a button initiating the event.

@solara.component
def Page():
    if not auth.user.value:
        redirect_to(href=auth.get_login_url())


What are my options?
Was this page helpful?