Share Your Regrets Anonymously.
A New Way to Begin: Introducing Google Sign-In to Regretify
At Regretify, our mission has always been to provide a safe and simple space for reflection. Today, we're taking a huge leap forward in that mission by streamlining our entire authentication process. We're excited to announce that Regretify is moving to an exclusive **Google Sign-In** system!
This change is all about making your journey with us more secure, seamless, and true to our core value of anonymity. Let's dive into what this means for you and the development adventure behind it.
What's New for Users?
We've removed the traditional email and password signup to focus on a single, secure method:
- Effortless & Secure Sign-In: No more passwords to remember! With just a tap, you can securely sign in using your Google account.
- True Anonymity from the Start: We **never** pull or use your Google profile picture. Your identity on Regretify is yours to create.
- Craft Your Persona: New users are now greeted with a profile creation screen. Here, you'll choose your anonymous **Display Name** and a unique **@username**, and can upload a custom avatar.
The Developer's Journey: Challenges & Solutions
Transitioning our authentication system was an exciting challenge. Our goal was to enhance user experience and security while ensuring all our existing users had a smooth transition. Here's a look behind the curtain.
Challenge 1: Supporting Old vs. New Users
Our biggest hurdle was supporting our loyal existing users who signed up with email and password, while only allowing new users to join via Google. We couldn't just delete the old password-based login system.
Solution: We refactored our backend logic. The `/api/auth/register` endpoint was removed to prevent new password-based signups. However, the `/api/auth/login` endpoint was kept fully functional. Our `googleSignIn` endpoint was enhanced to check if an email already exists with a password, gently guiding those users back to the traditional login screen.
Challenge 2: The "Name" vs. "Username" Conflict
Initially, `username` was the only name field. We introduced a new, changeable `name` field for display purposes. This created a problem: our old users didn't have a `name` in their database records! When our new UI tried to display `user.name`, it would find `null` and either crash the app or show nothing.
Solution (Defense in Depth):
- Backend Fallback: We updated every single API endpoint that returns user data. If a user document is missing the `name` field, our server now automatically populates it with the `username` before sending the response. This makes our API robust and backward-compatible.
- Frontend Centralization: On the Android app, we created a "computed property" on our `User` data model. A new `displayName` property intelligently checks "is the `name` field available? If yes, use it. If not, use the `username`." All our UI components (the feed, profile screens, friend lists) were then updated to use this single `displayName` property, ensuring consistency everywhere with a one-line change in the UI code.
Challenge 3: Avoiding Boring Temporary Usernames
When a new user signs up, they need a unique `@username` before they get to the "Create Profile" screen. Our first idea was a technical ID like `"user_12345abc"`, but that felt cold and impersonal.
Solution: We built a fun, anonymous name generator on our backend! Now, when you first sign up, you're assigned a creative display name like "Silent Voyager" and a unique username like `@silentvoyager123`. This immediately immerses new users in the anonymous, reflective spirit of Regretify, while still giving them full control to change it on the next screen.
These changes weren't just about code; they were about reinforcing trust and anonymity, the cornerstones of the Regretify experience.
What's Next?
This new authentication flow sets a strong foundation for the future. We're already working on more ways for you to customize your anonymous identity and connect with others safely.
Thank you for being part of this journey. We build Regretify for you, and your feedback is what shapes our path forward.
Happy reflecting,
The Regretify Team