Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

Fix types

Tomas Valentadb6f331e7c45
diff --git a/apps/dashboard/pages/settings/index.tsx b/apps/dashboard/pages/settings/index.tsx
index 6321ed619..7aaa8970d 100644
--- a/apps/dashboard/pages/settings/index.tsx
+++ b/apps/dashboard/pages/settings/index.tsx
@@ -41,7 +41,7 @@ export const getServerSideProps: GetServerSideProps<Props> = async (ctx) => {
if (apiKey) {
- apiKeyValue = apiKey?.api_key
+ apiKeyValue = apiKey.api_key
} else {
const user = await prisma.auth_users.findUniqueOrThrow({
where: {
@@ -91,6 +91,15 @@ export const getServerSideProps: GetServerSideProps<Props> = async (ctx) => {
})
}
+ if (!apiKeyValue) {
+ return {
+ redirect: {
+ destination: '/',
+ permanent: false,
+ },
+ }
+ }
+
return {
props: {
apiKey: apiKeyValue,