Fetch the user matching username from your database
# and compare the hashed password with the value stored in the database
if (username, password) == ("admin", "admin"):
return cl.User(
identifier="admin", metadata={"role": "admin", "provider": "credentials"}
)
else:
return None`
error info @fenglui @kvnn
File "/Users/qinyingjie/miniconda3/envs/base-agent/lib/python3.10/site-packages/chainlit/context.py", line 69, in get_context raise ChainlitContextException() chainlit.context.ChainlitContextException: Chainlit context not found
`from typing import Optional import chainlit as cl
@cl.password_auth_callback def auth_callback(username: str, password: str):
Fetch the user matching username from your database
error info @fenglui @kvnn
File "/Users/qinyingjie/miniconda3/envs/base-agent/lib/python3.10/site-packages/chainlit/context.py", line 69, in get_context raise ChainlitContextException() chainlit.context.ChainlitContextException: Chainlit context not found