Skip to content

Commit 93842f3

Browse files
feat(login): 登录页加 Google 登录按钮,设置页显示 Google 绑定名
1 parent 6c5d1c8 commit 93842f3

5 files changed

Lines changed: 6 additions & 2 deletions

File tree

‎app/[locale]/login/page.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export default async function LoginPage({ params }: Props) {
3838
<div className="flex flex-col items-center gap-3">
3939
<SignInButton provider="github" label={t("github")} />
4040
<SignInButton provider="discord" label={t("discord")} />
41+
<SignInButton provider="google" label={t("google")} />
4142
</div>
4243
</div>
4344
</div>

‎app/[locale]/settings/LinkedAccounts.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ function getToken(): string | null {
2222
const PROVIDER_LABEL: Record<string, string> = {
2323
github: "GitHub",
2424
discord: "Discord",
25+
google: "Google",
2526
};
2627

2728
export function labelOf(provider: string): string {

‎app/components/SignInButton.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import { armLoginNonce } from "@/lib/use-auth";
66
interface SignInButtonProps {
77
className?: string;
88
// 传了 provider(登录页两个按钮)→ 直跳该 provider 授权;
9-
// 不传(header 的 "Sign In")→ 跳 /login 让用户在 GitHub / Discord 间选。
10-
provider?: "github" | "discord";
9+
// 不传(header 的 "Sign In")→ 跳 /login 让用户在 GitHub / Discord / Google 间选。
10+
provider?: "github" | "discord" | "google";
1111
label?: string;
1212
}
1313

‎messages/en.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
"subheading": "Sign in to access protected pages",
7272
"github": "Sign in with GitHub",
7373
"discord": "Sign in with Discord",
74+
"google": "Sign in with Google",
7475
"errorDiscordCanary": "Discord sign-in is in limited testing and not open yet — stay tuned!",
7576
"errorGeneric": "Sign-in didn't complete. Please try again.",
7677
"errorOauthState": "Your sign-in session expired (took too long on the provider's page, or cookies were blocked). Please start the sign-in again.",

‎messages/zh.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
"subheading": "请登录以访问受保护的页面",
7272
"github": "用 GitHub 登录",
7373
"discord": "用 Discord 登录",
74+
"google": "用 Google 登录",
7475
"errorDiscordCanary": "Discord 登录正在灰度测试中,暂未对外开放,敬请期待~",
7576
"errorGeneric": "登录未完成,请重试。",
7677
"errorOauthState": "登录会话已失效(可能是等待授权太久,或浏览器拦截了 Cookie)。请重新点击登录。",

0 commit comments

Comments
 (0)