feat: How to implement a “guest mode” like chat.openai.com — support no-login usage (no chat history) but keep login/register features? #5613

Closed
opened 2025-11-11 16:26:20 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @xiongvalerio on GitHub (Jun 22, 2025).

Check Existing Issues

  • I have searched the existing issues and discussions.

Problem Description

I want to implement a “guest mode” similar to chat.openai.com, where users can start chatting without logging in. Currently, most implementations require login first, which limits accessibility for casual or anonymous users.

The problem is:
There’s no clear way to allow non-logged-in users to chat (with no chat history saved), while also keeping login/register functionality for those who want persistent sessions and features like saved chat history.

Desired Solution you'd like

I would like to:
• Allow users to chat directly without logging in (as a guest).
• Do not store any conversation history for guest users (session-based only, lost on refresh).
• Still provide login/register options.
• If a user logs in during or after chatting, offer an option to save their current session (optional).

Alternatives Considered

No response

Additional Context

No response

Originally created by @xiongvalerio on GitHub (Jun 22, 2025). ### Check Existing Issues - [x] I have searched the existing issues and discussions. ### Problem Description I want to implement a “guest mode” similar to [chat.openai.com](https://chat.openai.com/), where users can start chatting without logging in. Currently, most implementations require login first, which limits accessibility for casual or anonymous users. The problem is: There’s no clear way to allow non-logged-in users to chat (with no chat history saved), while also keeping login/register functionality for those who want persistent sessions and features like saved chat history. ### Desired Solution you'd like I would like to: • Allow users to chat directly without logging in (as a guest). • Do not store any conversation history for guest users (session-based only, lost on refresh). • Still provide login/register options. • If a user logs in during or after chatting, offer an option to save their current session (optional). ### Alternatives Considered _No response_ ### Additional Context _No response_
Author
Owner

@xiongvalerio commented on GitHub (Jun 22, 2025):

I noticed that this “guest mode” or anonymous usage request has been around for over a year, but it still hasn’t been implemented or officially addressed. It seems to be a valuable feature for many users, so I hope it can be seriously considered.

@xiongvalerio commented on GitHub (Jun 22, 2025): I noticed that this “guest mode” or anonymous usage request has been around for over a year, but it still hasn’t been implemented or officially addressed. It seems to be a valuable feature for many users, so I hope it can be seriously considered.
Author
Owner

@rgaricano commented on GitHub (Jun 22, 2025):

You can set a user for that, and login directly to that user with something like this:

<!DOCTYPE html>
<html lang="es">
<head>
  <meta charset="UTF-8">
  <title>Open WebUI AutoLogin</title>
  <script>
    async function autoLogin() {
      const credentials = {
        username: "anouser@example.com",
        password: "anouserpass123"
      };

      try {
        const response = await fetch("http://openwebui_ip:3000/api/auth/login", {
          method: "POST",
          headers: {
            "Content-Type": "application/json"
          },
          body: JSON.stringify(credentials),
          credentials: "include"
        });

        if (response.ok) {
          // Redirect after login
          window.location.href = "http://openwebui_ip:3000";
        } else {
          const data = await response.json();
          alert("Login failed: " + data.message);
        }
      } catch (error) {
        console.error("Connection Error:", error);
        alert("Could not connect to Open WebUI.");
      }
    }

    window.onload = autoLogin;
  </script>
</head>
<body>
  <h2>Automatically logging in Open WebUI...</h2>
</body>
</html>
@rgaricano commented on GitHub (Jun 22, 2025): You can set a user for that, and login directly to that user with something like this: ``` <!DOCTYPE html> <html lang="es"> <head> <meta charset="UTF-8"> <title>Open WebUI AutoLogin</title> <script> async function autoLogin() { const credentials = { username: "anouser@example.com", password: "anouserpass123" }; try { const response = await fetch("http://openwebui_ip:3000/api/auth/login", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(credentials), credentials: "include" }); if (response.ok) { // Redirect after login window.location.href = "http://openwebui_ip:3000"; } else { const data = await response.json(); alert("Login failed: " + data.message); } } catch (error) { console.error("Connection Error:", error); alert("Could not connect to Open WebUI."); } } window.onload = autoLogin; </script> </head> <body> <h2>Automatically logging in Open WebUI...</h2> </body> </html> ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#5613