Skip to content

Commit

Permalink
D:/Git/chatpage is in accessible
Browse files Browse the repository at this point in the history
  • Loading branch information
ShadowCat567 committed Apr 23, 2024
1 parent 1633529 commit e8f3acd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion back-end/Server.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ io.use((socket) => {
if(!sockUsername) {
console.log("No username received");
}
console.log(`Socket username: ${sockUsername}`);
socket.username = sockUsername;
console.log(`Socket username: ${socket.username}`);
});

io.on('connection', (socket) => {
Expand Down
2 changes: 1 addition & 1 deletion front-end/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function App() {
<Routes>
<Route path="/login" element={<LoginForm />} />
<Route path="/register" element={<RegistrationForm />} />
<Route path="/chatpage" element={<ProtectedRoute><ChatPage /></ProtectedRoute>} />
<Route path="/chatpage/:username" element={<ProtectedRoute><ChatPage /></ProtectedRoute>} />
<Route path="/chatlist" element={<ProtectedRoute><ChatList /></ProtectedRoute>} />
<Route path="/matches" element={<ProtectedRoute><Matches /></ProtectedRoute>} />
<Route path="/survey" element={<ProtectedRoute><Survey /></ProtectedRoute>} />
Expand Down
2 changes: 1 addition & 1 deletion front-end/src/LoginForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function LoginForm() {
console.log('Login successful:', data);

//connect the chat socket and register its username
socket.auth.username = username;
socket.auth = { username };
socket.connect();

localStorage.setItem('token', data.token); // Save the token to localStorage
Expand Down

0 comments on commit e8f3acd

Please sign in to comment.