Skip to content

armgit / E2B

Public Imported from GitHub
0

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

Change auth buttons to links in header

Vasek Mlejnsky81e4f292a962
diff --git a/apps/docs/src/components/Auth.tsx b/apps/docs/src/components/Auth.tsx
index 13faf037c..9cac1badf 100644
--- a/apps/docs/src/components/Auth.tsx
+++ b/apps/docs/src/components/Auth.tsx
@@ -1,6 +1,7 @@
'use client'
import clsx from 'clsx'
+import Link from 'next/link'
import { LogOutIcon } from 'lucide-react'
import { useRouter } from 'next/navigation'
@@ -11,7 +12,6 @@ import { CopyButton } from '@/components/CopyButton'
import { HeaderSeparator } from '@/components/HeaderUtils'
import { usePostHog } from 'posthog-js/react'
import { obfuscateSecret } from '@/utils/obfuscate'
-import { useSignIn } from '@/utils/useSignIn'
function CopyableSecret({
secret = '',
@@ -46,7 +46,6 @@ function CopyableSecret({
export const Auth = function () {
const { user, isLoading, error } = useUser()
- const signIn = useSignIn()
const apiKey = useApiKey()
const posthog = usePostHog()
const router = useRouter()
@@ -59,14 +58,16 @@ export const Auth = function () {
window.location.reload()
}
+
if (error)
return (
<div className="flex flex-row items-center gap-4">
<span className="text-sm text-red-500" title={error?.message}>
Something went wrong
</span>
- {/* @ts-ignore */}
- <Button onClick={() => signIn()}>Sign In</Button>
+ <Link href="/sign-in">
+ <Button>Sign In</Button>
+ </Link>
</div>
)
@@ -113,16 +114,18 @@ export const Auth = function () {
</div>
) : (
<div className="flex items-center justify-center gap-3">
- {/* @ts-ignore */}
- <Button
- onClick={() => signIn({ view: 'sign-up' })}
- variant="textTernary"
- className="whitespace-nowrap text-xs"
- >
- Sign up to get your API key
- </Button>
- {/* @ts-ignore */}
- <Button onClick={() => signIn()}>Sign In</Button>
+ <Link href="/sign-in?view=sign-up">
+ <Button
+ variant="textTernary"
+ className="whitespace-nowrap text-xs"
+ >
+ Sign up to get your API key
+ </Button>
+ </Link>
+
+ <Link href="/sign-in">
+ <Button>Sign In</Button>
+ </Link>
</div>
)}
</>
diff --git a/apps/docs/src/components/AuthForm.tsx b/apps/docs/src/components/AuthForm.tsx
index 859ac9770..3b312c151 100644
--- a/apps/docs/src/components/AuthForm.tsx
+++ b/apps/docs/src/components/AuthForm.tsx
@@ -46,7 +46,7 @@ function AuthForm() {
<div className="mx-auto flex flex-1 w-full justify-center items-center flex-col pt-4">
<h1 className="text-4xl font-bold mt-8 mb-4">
{view === 'sign_in' && 'Sign in to E2B'}
- {view === 'sign_up' && 'Sign up to E2B'}
+ {view === 'sign_up' && 'Create new account on E2B'}
{view === 'forgotten_password' && 'Reset password'}
</h1>
<div className="md:w-[420px] w-[240px]">