Skip to content

Open source AI coding agent. Designed for large projects and real world tasks.

Refactored email verification to handle different actions based on environment variables.

Alan Young392e12b630ac
diff --git a/app/server/email/verification.go b/app/server/email/verification.go
index ff417ab9..f7e3d7d3 100644
--- a/app/server/email/verification.go
+++ b/app/server/email/verification.go
@@ -25,20 +25,22 @@ func SendVerificationEmail(email string, pin string) error {
if os.Getenv("GOENV") == "development" {
// Development environment
- // Copy pin to clipboard
- if err := clipboard.WriteAll(pin); err != nil {
- return fmt.Errorf("error copying pin to clipboard in dev: %v", err)
- }
-
- // Dump pin to log output
- fmt.Printf("Development mode: Verification pin is %s for email %s\n", pin, email)
- // Send notification
- err := beeep.Notify("Verification Pin", fmt.Sprintf("Verification pin %s copied to clipboard %s", pin, email), "")
- if err != nil {
- return fmt.Errorf("error sending notification in dev: %v", err)
+ if os.Getenv("PIN2LOG") == "yes" {
+ // Dump pin to log output
+ fmt.Printf("Development mode: Verification pin is %s for email %s\n", pin, email)
+ } else {
+ // Copy pin to clipboard
+ if err := clipboard.WriteAll(pin); err != nil {
+ return fmt.Errorf("error copying pin to clipboard in dev: %v", err)
+ }
+
+ // Send notification
+ err := beeep.Notify("Verification Pin", fmt.Sprintf("Verification pin %s copied to clipboard %s", pin, email), "")
+ if err != nil {
+ return fmt.Errorf("error sending notification in dev: %v", err)
+ }
}
-
}
return nil