Skip to content

Commit

Permalink
Feat/chengyue bot (#142)
Browse files Browse the repository at this point in the history
feat: add white domain
feat: update home page style
  • Loading branch information
xingwanying authored Jun 11, 2024
2 parents 5ccb5f7 + 5d95297 commit 2146be0
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion client/app/factory/list/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default function List() {
}

return (
<div className="container mx-auto ">
<div className="mx-auto ">
<div className="mt-8">
<div className="grid grid-flow-row-dense grid-cols-4 gap-4 my-8 justify-items-center px-[20px]">
<AddBotCard />
Expand Down
2 changes: 1 addition & 1 deletion client/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default function Home() {

return (
<div>
<div className="container mx-auto">
<div className="mx-auto">
<div className="grid grid-flow-row-dense gap-8 my-8 justify-items-center px-[20px] md:grid-cols-2 lg:grid-cols-4">
<BotList type="list" />
{!isEmpty(bots) &&
Expand Down
1 change: 0 additions & 1 deletion server/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
is_dev = bool(get_env_variable("IS_DEV"))
session_secret_key = get_env_variable("FASTAPI_SECRET_KEY")
cors_origins_whitelist = get_env_variable("CORS_ORIGIN_WHITELIST") or ''

app = FastAPI(
title="Bo-meta Server",
version="1.0",
Expand Down
4 changes: 2 additions & 2 deletions server/routers/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ async def getAnonymousUser(request: Request, response: Response):

@router.get("/login")
def login():
print(f'redirect_uri={CALLBACK_URL}')
redirect_uri = f"https://{AUTH0_DOMAIN}/authorize?audience={API_AUDIENCE}&response_type=code&client_id={CLIENT_ID}&redirect_uri={CALLBACK_URL}&scope=openid profile email&state=STATE"
return RedirectResponse(redirect_uri)

Expand All @@ -68,8 +67,9 @@ async def callback(request: Request, response: Response):
if not code:
raise HTTPException(status_code=status.HTTP_401_UNAUTHORIZED, detail="Missing authorization code")
token = await getTokenByCode(code)
if not token:
raise HTTPException(status_code=status.HTTP_401_UNAUTHORIZED, detail="Missing authorization token")
data = await getUserInfoByToken(token)

supabase = get_client()
supabase.table("profiles").upsert(data).execute()
response = RedirectResponse(url=f'{WEB_URL}', status_code=302)
Expand Down

0 comments on commit 2146be0

Please sign in to comment.