Skip to content

Commit 58a4522

Browse files
committed
Properly hook authentication up to message
1 parent 3946273 commit 58a4522

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

peerprep/components/questionpage/CollabEditor.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,9 @@ export default function CollabEditor({
156156
};
157157

158158
newSocket.onmessage = (event) => {
159-
if (event.data == "Authentication failed") {
159+
if (event.data == "Auth Success") {
160+
setAuthenticated(true);
161+
} else if (event.data == "Authentication failed") {
160162
window.alert("Authentication failed");
161163
newSocket.close();
162164
router.push("/questions");

0 commit comments

Comments
 (0)