Skip to content

Please fix the FastAPI usage. File auth.py #1458

@vohaha7

Description

@vohaha7

⚠️ Check for existing issues before proceeding. ⚠️

  • I have searched the existing issues, and there is no existing issue for my problem

Where are you using SuperAGI?

Linux

Which branch of SuperAGI are you using?

Main

Do you use OpenAI GPT-3.5 or GPT-4?

GPT-3.5

Which area covers your issue best?

Installation and setup

Describe your issue.

File auth.py:

  1. Add Request Class import:
    from fastapi import Request, Depends, HTTPException, Header, Security, status

  2. FastAPI does not need to extra wrap Request. It's autoinjected:
    def get_current_user(request: Request, Authorize: AuthJWT = Depends(check_auth)):

How to replicate your Issue?

No response

Upload Error Log Content

  1. File "/app/superagi/helper/auth.py", line 47, in def get_current_user(Authorize: AuthJWT = Depends(check_auth), request: Request = Depends()): NameError: name 'Request' is not defined; 2) AssertionError: Cannot specify Depends for type <class 'starlette.requests.Request'>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions