How to make a callback see that the url changes when it stays the same

Hi everyone, i have a dash code that has two pages (login page and graficos page) the user only can access the graficos page if he is logged, in case he is not logged he is redirected to the login page. My problem is that after the user tries to see the graficos page without beign logged and logging in the layout doesn’t change, and i find out that is because the callback don’t see the url changing, but it’s changing, does anyone know how can i make to trigger a callback even if the Input value apparently don’t change?

Here is the code:

from dash import Dash
from dash_bootstrap_components import themes
import os
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager, UserMixin

app = Dash(__name__, external_stylesheets=[themes.BOOTSTRAP])
server = app.server
app.config.suppress_callback_exceptions = True


db = SQLAlchemy(server)

login_manager = LoginManager(server)

class Usuarios(db.Model, UserMixin):
    __tablename__ = "usuarios"

    id = db.Column(db.Integer, primary_key=True)
    u_nome = db.Column(db.String(50), nullable=False)
    p_nome = db.Column(db.String(50), nullable=False)
    login = db.Column(db.String(50), nullable=False)
    senha_hash = db.Column(db.String(255), nullable=False)

def load_user(user_id):
    return Usuarios.query.get(int(user_id))

import dash_bootstrap_components as dbc
from dash import Output, Input, State, dcc
from flask_login import login_user
from app import app, Usuarios
import hashlib

layout = dbc.Form([
    dbc.Input(type="text", id="login-field", placeholder="Digite seu login"),
    dbc.Input(type="password", id="password-field", placeholder="Digite sua senha"),
    dbc.Button("Login", id="login-button", n_clicks=0)

    Output("url_login", "pathname"),
    Input("login-button", "n_clicks"),
        State("login-field", "value"),
        State("password-field", "value")
def make_login(n_clicks, login, password):
    usuario = Usuarios.query.filter_by(login=login).first()

    if n_clicks != 0:
        if usuario:
            check_password = usuario.senha_hash
            hashed_password = hashlib.sha256(password.encode()).hexdigest()

            if check_password == hashed_password:

                print("tá logando")

                return "/graficos"
                print("senha errada")
            print("usuário não cadastrado")

from dash import html, dcc, Output, Input
from app import app
from pages import login, graficos
from flask_login import current_user

app.layout = html.Div([
    dcc.Location(id="url", refresh=False),

    Output("page-content", "children"),
    Input("url", "pathname")
def change_page(pathname):
    print(f"{'==='*30}\nUsuário autenticado: {current_user.is_authenticated}")
    if pathname == "/":
        print("entrou na página de login")
        return login.layout
    elif pathname == "/graficos":
        print("entrou na página de gráficos")
        if current_user.is_authenticated:
            return graficos.layout
            print("não logou")
            return login.layout
        return "404"

if __name__ == "__main__":

You may to need change refresh to True in the dcc.location on This will refresh the page once a change has been made to the pathname.

it doesn’t work T__T