Open 4shub opened 3 months ago
I get same issue on AWS Linux, but not on Mac
It happens on Mac too.
I had a few minutes to try a rough test and simply stripping the user-
prefix from the authentication response allows the user to login. No idea the ramifications of this but I figured I'd share.
# memgpt/server/rest_api/auth/index.py
... # truncated
@router.post("/auth", tags=["auth"], response_model=AuthResponse)
def authenticate_user(request: AuthRequest) -> AuthResponse:
"""
Authenticates the user and sends response with User related data.
Currently, this is a placeholder that simply returns a UUID placeholder
"""
interface.clear()
is_admin = False
if request.password != password:
response = server.api_key_to_user(api_key=request.password)
else:
is_admin = True
response = server.authenticate_user()
# adding the 2 lines below allows the login
if response.startswith("user-"):
response = response[5:]
return AuthResponse(uuid=response, is_admin=is_admin)
I'm not sure the background of the id format change but my first thought was to add a display property on the AuthResponse
class and allow flexible validation with the user id formats interchangeable.
Describe the bug If you successfully enter in a password to
/auth
, you will not be able to login as the UUID returned is not valid inAuthResponse
Error Message
Possible Solution It seems like we are passing the API_KEY as the UUID on this successful auth response instead of a UUID.