Chainlit / chainlit

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

while login, get Unable to sign in #1018

Open qyj19920704 opened 6 months ago

qyj19920704 commented 6 months 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 6 months ago

This might be fixed in the pre release