- {/*
*/}
- {/* */}
- {/*
*/}
Login
Enter your informations bellow to login
diff --git a/src/components/wrappers/auth/login/socialAuth/socialAuthButtons/SocialAuthButton.tsx b/src/components/wrappers/auth/login/socialAuth/socialAuthButtons/SocialAuthButton.tsx
index 21fe9cf8..3cfc43a5 100644
--- a/src/components/wrappers/auth/login/socialAuth/socialAuthButtons/SocialAuthButton.tsx
+++ b/src/components/wrappers/auth/login/socialAuth/socialAuthButtons/SocialAuthButton.tsx
@@ -2,21 +2,24 @@
import {signInAction} from "@/features/auth/auth.action";
import {Button} from "@/components/ui/button";
import Image from "next/image";
+import {env} from "@/env.mjs";
export type SocialAuthButtonProps = {}
export const SocialAuthButton = (props: SocialAuthButtonProps) => {
return (
-
+ {env.NEXT_PUBLIC_GOOGLE_AUTH === "true" ?
+
+ :null}
)
}
\ No newline at end of file
diff --git a/src/components/wrappers/common/button/copy-button.tsx b/src/components/wrappers/common/button/copy-button.tsx
index 96e5fd5e..84a45b92 100644
--- a/src/components/wrappers/common/button/copy-button.tsx
+++ b/src/components/wrappers/common/button/copy-button.tsx
@@ -13,7 +13,8 @@ export async function copyToClipboardWithMeta(value: string) {
export type CopyButtonProps = {
- value: string
+ value: string,
+ className: string
}
diff --git a/src/components/wrappers/dashboard/agent/AgentCardKey/AgentCardKey.tsx b/src/components/wrappers/dashboard/agent/AgentCardKey/AgentCardKey.tsx
new file mode 100644
index 00000000..c31be231
--- /dev/null
+++ b/src/components/wrappers/dashboard/agent/AgentCardKey/AgentCardKey.tsx
@@ -0,0 +1,25 @@
+"use client"
+import {generateEdgeKey} from "@/utils/edge_key";
+import {getServerUrl} from "@/utils/get-server-url";
+import {Agent} from "@prisma/client";
+import {PasswordInput} from "@/components/wrappers/auth/PaswordInput/password-input";
+import {useState} from "react";
+import {CopyButton} from "@/components/wrappers/common/button/copy-button";
+
+export type AgentCardKeyProps = {
+ agent: Agent
+
+}
+
+export const AgentCardKey = (props: AgentCardKeyProps) => {
+ const edge_key = generateEdgeKey(getServerUrl(), props.agent.id);
+ const [code, setCode] = useState
(`${edge_key}`);
+
+
+ return(
+ <>
+ {setCode(edge_key)} }/>
+
+ >
+ )
+}
\ No newline at end of file
diff --git a/src/env.mjs b/src/env.mjs
index 4ea717f8..c555fea2 100644
--- a/src/env.mjs
+++ b/src/env.mjs
@@ -31,6 +31,7 @@ export const env = createEnv({
S3_USE_SSL: z.string().optional(),
STORAGE_TYPE: z.string().optional(),
+ NEXT_PUBLIC_GOOGLE_AUTH: z.string().optional(),
},
/*
@@ -40,6 +41,7 @@ export const env = createEnv({
*/
client: {
NEXT_PUBLIC_DOMAIN_NAME: z.string(),
+ NEXT_PUBLIC_GOOGLE_AUTH: z.string().optional(),
},
/*
* Due to how Next.js bundles environment variables on Edge and Client,
@@ -62,6 +64,7 @@ export const env = createEnv({
AUTH_GOOGLE_ID: process.env.AUTH_GOOGLE_ID,
AUTH_GOOGLE_SECRET: process.env.AUTH_GOOGLE_SECRET,
+ NEXT_PUBLIC_GOOGLE_AUTH: process.env.NEXT_PUBLIC_GOOGLE_AUTH,
S3_ENDPOINT: process.env.S3_ENDPOINT,
S3_ACCESS_KEY: process.env.S3_ACCESS_KEY,
diff --git a/src/features/auth/auth.action.ts b/src/features/auth/auth.action.ts
index 9a183dd4..40928f98 100644
--- a/src/features/auth/auth.action.ts
+++ b/src/features/auth/auth.action.ts
@@ -18,8 +18,6 @@ export const signInAction = async (type: string, formData?: any) => {
email: formData.email
});
} catch (error) {
- // const signInError = error as CredentialsSignin
- console.error(error);
return {error: "Error loging in, please try again or check your credentials !"};
}
redirect("/")