Skip to content

Commit

Permalink
fix: add auth0 related requirement
Browse files Browse the repository at this point in the history
  • Loading branch information
xingwanying committed May 7, 2024
1 parent 154ca81 commit 58f3508
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
10 changes: 10 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,13 @@ OPENAI_API_KEY=openapi_api_key

# Tavily Api Key
TAVILY_API_KEY=tavily_api_key

# AUTH0 Configures
API_IDENTIFIER=api_identifier
FASTAPI_SECRET_KEY=fastapi_secret_key

AUTH0_DOMAIN=auth0_domain
AUTH0_CLIENT_ID=auth0_client_id
AUTH0_CLIENT_SECRET=auth0_client_secret
API_URL=api_url
WEB_URL=web_url
4 changes: 0 additions & 4 deletions requirements.txt

This file was deleted.

6 changes: 6 additions & 0 deletions server/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,9 @@ boto3>=1.34.84
pyjwt>=2.4.0
pydantic>=2.7.0
unstructured[md]
python-dotenv
python-jose
six
jose
itsdangerous
fastapi_auth0
8 changes: 4 additions & 4 deletions server/routers/auth.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from fastapi import APIRouter,Cookie, Depends, Security, Request, HTTPException, status, Response
from fastapi import APIRouter,Cookie, Request, HTTPException, status, Response
from uilts.env import get_env_variable
from fastapi_auth0 import Auth0, Auth0User
from fastapi.responses import RedirectResponse, JSONResponse
from fastapi_auth0 import Auth0
from fastapi.responses import RedirectResponse
import httpx
from db.supabase.client import get_client
import secrets
Expand Down Expand Up @@ -94,4 +94,4 @@ async def userinfo(petercat: str = Cookie(None)):
if data :
return { "data": data, "status": 200}
else:
return RedirectResponse(url=LOGIN_URL, status_code=303)
return RedirectResponse(url=LOGIN_URL, status_code=303)

0 comments on commit 58f3508

Please sign in to comment.