From c535e037fcd732eb9fe1655a96ccb728cc6a7c13 Mon Sep 17 00:00:00 2001 From: wood chen Date: Fri, 21 Feb 2025 15:42:40 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E6=9B=B4=E6=96=B0README=E4=BB=A5?= =?UTF-8?q?=E5=8C=85=E5=90=AB=E9=A1=B9=E7=9B=AE=E9=83=A8=E7=BD=B2=E7=BD=91?= =?UTF-8?q?=E5=9D=80=E5=92=8CQ58=E8=AE=BA=E5=9D=9B=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=EF=BC=9B=E4=BC=98=E5=8C=96=E7=94=A8=E6=88=B7=E6=8E=88=E6=9D=83?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E7=9A=84=E7=99=BB=E5=BD=95=E5=9B=9E=E8=B0=83?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 10 +++++++++- src/components/auth/user-authorize.tsx | 6 ++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 61fbf25..8482f9d 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,19 @@ # Discourse Connect -这是一个基于Next.js,实现了使用 Discourse SSO (Single Sign-On) 用户系统的 OAuth 认证功能。 +这是一个基于Next.js, 实现了使用 Discourse SSO (Single Sign-On) 用户系统的 OAuth 认证功能。 + +前端UI使用shadcn/ui. + +> shadcn安装组件的命令,举例: npx shadcn@latest add button ## 项目概述 本项目提供了一个 OAuth 认证系统,允许其他应用程序使用 Discourse 论坛的用户账号进行身份验证。这样可以让用户使用他们已有的 Discourse 账号登录到您的应用程序,无需创建新的账号。 +目前Discourse论坛是Q58论坛. +Q58论坛网址: https://q58.club +本项目部署网址: https://connect.q58.club + 主要特性: - 基于 Discourse SSO 的用户认证 diff --git a/src/components/auth/user-authorize.tsx b/src/components/auth/user-authorize.tsx index ca06d09..5655d20 100644 --- a/src/components/auth/user-authorize.tsx +++ b/src/components/auth/user-authorize.tsx @@ -55,8 +55,10 @@ export function UserAuthorize({ }, [isLoading, update, router]); useEffect(() => { - // 直接执行登录回调 - signInCallback(); + const timer = setTimeout(signInCallback, 5); + return () => { + clearTimeout(timer); + }; }, [signInCallback]); if (error) {