HI gaw89:
When i add some logic in login function,it doesn't work properly,for exsample,time.sleep(3)
`# This callback to the login app should encapsulate the login functionality
Set the output to a non-visible location
@login_app.callback(
Output('h1', 'n_clicks'),
[Input('submit-button', 'n_clicks')],
[State('uname-box', 'value'),
State('pwd-box', 'value')]
)
def login(n_clicks, uname, pwd):
sql='select password from users where user=%s'
params=[uname]
cu.execute(sql,params)
password=cu.fetchone()
if uname == 'user' and pwd == 'password':
login_user(load_user(users[0].name))
else:pass
@sylvoslee What actually happens when you use this code? Does it produce an error? Does it just not log you in? If you can provide more detail, I'll see what I can do.
HI gaw89: When i add some logic in login function,it doesn't work properly,for exsample,time.sleep(3) `# This callback to the login app should encapsulate the login functionality
Set the output to a non-visible location