Add Discord to supported OAuth providers
cgen-520b7aed050442f6b12f57fe9e555355
This commit is contained in:
parent
56ff6af853
commit
fe49f35017
1 changed files with 3 additions and 3 deletions
|
|
@ -19,7 +19,7 @@ import {
|
||||||
checkProfileComplete,
|
checkProfileComplete,
|
||||||
} from "@/lib/aethex-database-adapter";
|
} from "@/lib/aethex-database-adapter";
|
||||||
|
|
||||||
type SupportedOAuthProvider = "github" | "google";
|
type SupportedOAuthProvider = "github" | "google" | "discord";
|
||||||
|
|
||||||
interface LinkedProvider {
|
interface LinkedProvider {
|
||||||
provider: SupportedOAuthProvider;
|
provider: SupportedOAuthProvider;
|
||||||
|
|
@ -743,7 +743,7 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({
|
||||||
|
|
||||||
const identities = (user.identities ?? []) as any[];
|
const identities = (user.identities ?? []) as any[];
|
||||||
const supportedLinkedCount = identities.filter((item: any) =>
|
const supportedLinkedCount = identities.filter((item: any) =>
|
||||||
["github", "google"].includes(item.provider),
|
["github", "google", "discord"].includes(item.provider),
|
||||||
).length;
|
).length;
|
||||||
const hasEmailIdentity = identities.some(
|
const hasEmailIdentity = identities.some(
|
||||||
(item: any) => item.provider === "email",
|
(item: any) => item.provider === "email",
|
||||||
|
|
@ -978,7 +978,7 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({
|
||||||
};
|
};
|
||||||
|
|
||||||
const linkedProviders = useMemo<LinkedProvider[]>(() => {
|
const linkedProviders = useMemo<LinkedProvider[]>(() => {
|
||||||
const supported: SupportedOAuthProvider[] = ["github", "google"];
|
const supported: SupportedOAuthProvider[] = ["github", "google", "discord"];
|
||||||
if (!user?.identities) return [];
|
if (!user?.identities) return [];
|
||||||
return (user.identities as any[])
|
return (user.identities as any[])
|
||||||
.filter((identity) =>
|
.filter((identity) =>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue