Implementing Login/user resistration

How have you all been managing with login/user authentications? Have tried so many methods, Agent suggessted ones, Replit Auth 2.0, even debugging with my completely novice coding skills. But, cannot get past login screens. Surely there is an intuitive/functioning method. Thanks all.

Hi, I never had any issues with it. Did you see the “Register” link?

1 Like

Hi, so far I have found the best success using the Firebase Console for Login/ User registration. This will allow you to use Login with Google, Email / Password, Email or SMS with OTP for /auth.

You may get a cannot “Generate New Private Key” to download a JSON file due to restrictions enabled on the account, if so prompt Application Default Credentials (ADC) a better more secure approach instead of modifying org policies.

Hope this helps !

1 Like

I just wanted to say, as a new and unskilled user, creating a workable (or even working) auth is maybe the hardest bit.

One weird trick I learned: auth is much easier if you don’t try and test within the captive window. Open in a separate tab and it’s more likely to work.

1 Like

If you are looking for a simple auth process (such as sending a code to an email address) you can use sendgrid (https://sendgrid.com/) - Email API - ensure you use the specific email address that is verified in your account or else it won’t work. I agree with Firebase for more of a structured solution though.

1 Like

This is a great observation. Something about how the captive browser window works in Replit does not always accurately represent if the login/auth features are working. This is almost always the case if I build something on the desktop and then try and test on the Replit mobile app, but in the webview captive browser.

1 Like

I have seen a bug that is only on Mac running Safari where cookies are not properly stored in the Webview browser. PC running Edge or Firefox can use Webview inside Replit just fine and store session cookies. Also, if you run in Safari outside the Webview on Mac it seems to work fine as well.

This could prevent many simple login/session flows from working on Mac. I don’t know if it’s widespread or the same issue for me as what you’re seeing though.

1 Like

I’m so glad to see I’m not the only one struggling with these issues. I figured this would be the simplest part of the app for the Agent as it’s such a common use case.

But can you clarify - HOW do you use Firebase Console for this? Do you tell the Agent to implement it as part of your prompting during creation? As a newbie to this (but someone who programmed for years, just have been out of doing it for about 7 years now), do I need to set up Firebase somewhere and tell the agent to connect/use it? or can the agent set up whatever is needed?

Thanks!

This is useful, thank you.

I think this is part of the issue, thank you.

Good thought, I may try this. Needs to be simple

Yes! Let me try a workaround for this. Thank you.

Here’s a GPT answer which may or may not be completely accurate, but seems to map to my experience with it. It’s strange that this issue isn’t more widely documented or explained.

Replit’s internal browser behaves differently across operating systems and browsers because it relies on the underlying webview technology provided by the OS. Here’s why you’re seeing different cookie behaviors:

Windows (Edge) vs. Mac (Safari) Cookie Behavior in Replit

Windows (Edge)

  • Replit’s internal browser on Windows likely uses WebView2, which is based on Chromium/Edge.
  • WebView2 supports persistent cookies unless explicitly disabled.
  • This means cookies work similarly to a regular Chrome/Edge session.

Mac (Safari)

  • Replit’s internal browser on macOS is based on WKWebView, which has stricter cookie policies.
  • WKWebView does not persist cookies by default, especially in sandboxed environments.
  • Safari’s Intelligent Tracking Prevention (ITP) can also block third-party cookies and limit cookie persistence in embedded web views.

Why the Difference?

  1. Different Web Engines

    • Windows uses Chromium (Edge/WebView2) → More permissive with cookies.
    • macOS uses WebKit (Safari/WKWebView) → Stricter cookie handling.
  2. Security & Privacy Policies

    • Safari (WKWebView) enforces ITP, which limits third-party and session cookies.
    • Edge (WebView2) follows Chromium’s more relaxed cookie handling.
  3. Sandboxing in Replit

    • If Replit runs inside a sandboxed WebView, macOS will block persistent cookies.
    • Windows’ WebView2 may allow them unless specifically restricted.

Workarounds for macOS (Safari/WKWebView)

  • Use an External Browser: Open Replit in a full browser (Chrome/Firefox) instead of the internal preview.
  • Test with a Chromium-Based Browser: If you need consistent cookie behavior, try Google Chrome on macOS instead of Safari.
  • Check Storage API: Some WebKit environments block cookies but allow localStorage or IndexedDB as an alternative.
1 Like