Chainlit / chainlit

Build Conversational AI in minutes ⚡️
https://docs.chainlit.io
Apache License 2.0
6.1k stars 777 forks source link

while login, get Unable to sign in #1018

Open qyj19920704 opened 1 month ago

qyj19920704 commented 1 month ago

`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

# 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

willydouhard commented 1 month ago

This might be fixed in the pre release