Skip to content

Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active

Merge branch 'master' into feat-model-based-on-key

Danny Avila1fe9e29187c6
diff --cc api/server/index.js
index f3507fc2e9,102811b60e..2351e8a888
--- a/api/server/index.js
+++ b/api/server/index.js
@@@ -22,20 -30,27 +30,35 @@@ app.get('/', routes.authenticatedOrRedi
res.sendFile(path.join(projectPath, 'public', 'index.html'));
});
- app.use('/api/ask', routes.ask);
- app.use('/api/messages', routes.messages);
- app.use('/api/convos', routes.convos);
- app.use('/api/customGpts', routes.customGpts);
- app.use('/api/prompts', routes.prompts);
+ app.get('/api/me', function (req, res) {
+ if (userSystemEnabled) {
+ const user = req?.session?.user
+
+ if (user)
+ res.send(JSON.stringify({username: user?.username, display: user?.display}));
+ else
+ res.send(JSON.stringify(null));
+ } else {
+ res.send(JSON.stringify({username: 'anonymous_user', display: 'Anonymous User'}));
+ }
+ });
+
+ app.use('/api/ask', routes.authenticatedOr401, routes.ask);
+ app.use('/api/messages', routes.authenticatedOr401, routes.messages);
+ app.use('/api/convos', routes.authenticatedOr401, routes.convos);
+ app.use('/api/customGpts', routes.authenticatedOr401, routes.customGpts);
+ app.use('/api/prompts', routes.authenticatedOr401, routes.prompts);
+ app.use('/auth', routes.auth);
+
+app.get('/api/models', function (req, res) {
+ const hasOpenAI = !!process.env.OPENAI_KEY;
+ const hasChatGpt = !!process.env.CHATGPT_TOKEN;
+ const hasBing = !!process.env.BING_TOKEN;
+
+ res.send(JSON.stringify({ hasOpenAI, hasChatGpt, hasBing }));
+});
+
app.listen(port, host, () => {
if (host=='0.0.0.0')
console.log(`Server listening on all interface at port ${port}. Use http://localhost:${port} to access it`);
diff --cc client/src/App.jsx
index cd90ba2b48,0421d14d93..78943710e5
--- a/client/src/App.jsx
+++ b/client/src/App.jsx
@@@ -5,10 -5,15 +5,15 @@@ import TextChat from './components/Main
import Nav from './components/Nav';
import MobileNav from './components/Nav/MobileNav';
import useDocumentTitle from '~/hooks/useDocumentTitle';
- import { useDispatch, useSelector } from 'react-redux';
+ import { useSelector, useDispatch } from 'react-redux';
+ import { setUser } from './store/userReducer';
-import axios from 'axios'
++import axios from 'axios';
const App = () => {
+ const dispatch = useDispatch();
+
const { messages, messageTree } = useSelector((state) => state.messages);
+ const { user } = useSelector((state) => state.user);
const { title } = useSelector((state) => state.convo);
const { conversationId } = useSelector((state) => state.convo);
const [ navVisible, setNavVisible ]= useState(false)