-
Notifications
You must be signed in to change notification settings - Fork 79
feat: add auth0 related service #95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
components/User.tsx
Outdated
|
||
export default function Profile() { | ||
const { user } = useUser(); | ||
|
||
if (!user) { | ||
return ( | ||
<Button as={Link} color="primary" href="/api/auth/login" variant="flat"> | ||
<Button as={Link} color="primary" href="http://127.0.0.1:8000/api/auth/login" variant="flat"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
url得替换?
components/User.tsx
Outdated
@@ -1,12 +1,13 @@ | |||
import { useUser } from '@auth0/nextjs-auth0/client'; | |||
// import { useUser } from '@auth0/nextjs-auth0/client'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
没用删掉?
app/hooks/useUser.ts
Outdated
import useSWR from 'swr'; | ||
|
||
// 定义 fetcher 函数,这个函数用于发送 HTTP 请求 | ||
const fetcher = (url: string) => fetch(url, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
请求都放services里,axio
app/hooks/useUser.ts
Outdated
@@ -0,0 +1,20 @@ | |||
import useSWR from 'swr'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
统一 useQuery 吧
requirements.txt
Outdated
@@ -0,0 +1,6 @@ | |||
flask |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不需要flask
requirements.txt
Outdated
flask | ||
python-dotenv | ||
python-jose | ||
flask-cors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
flask-cors 也不用
server/main.py
Outdated
app.add_middleware( | ||
CORSMiddleware, | ||
allow_origins=["*"], # 明确指定允许的源 | ||
allow_credentials=True, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add python login and auth0
add getUserInfo api