Skip to content

armgit / E2B

Public Imported from GitHub
0

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

Add sign out button

Vasek Mlejnsky60f94557e602
diff --git a/pages/agent/smol-developer.tsx b/pages/agent/smol-developer.tsx
index 41e0b8427..debb4ba3c 100644
--- a/pages/agent/smol-developer.tsx
+++ b/pages/agent/smol-developer.tsx
@@ -24,6 +24,10 @@ function SmolDeveloper() {
console.log({ data, error })
}
+ async function signOut() {
+ await supabaseClient.auth.signOut()
+ }
+
return (
<div className="
p-8
@@ -39,10 +43,17 @@ function SmolDeveloper() {
text="Smol Developer"
/>
- <Button
- text="Sign in with GitHub"
- onClick={signInWithGitHub}
- />
+ {user ? (
+ <Button
+ text="Sign out"
+ onClick={signOut}
+ />
+ ) : (
+ <Button
+ text="Sign in with GitHub"
+ onClick={signInWithGitHub}
+ />
+ )}
</div>
)
}