From 228a3c10cfc292a27f4d6cc6a0db164d14c8044a Mon Sep 17 00:00:00 2001 From: Youjin Lee Date: Thu, 6 May 2021 10:39:38 +0900 Subject: [PATCH] =?UTF-8?q?[client]=20/=20entryGame=20=EA=B8=B0=EB=8A=A5?= =?UTF-8?q?=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/WaitingPages/components/EntryGame.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/WaitingPages/components/EntryGame.js b/src/WaitingPages/components/EntryGame.js index 80e12e8..ebb0edf 100644 --- a/src/WaitingPages/components/EntryGame.js +++ b/src/WaitingPages/components/EntryGame.js @@ -2,13 +2,22 @@ import React from 'react'; import { useHistory } from 'react-router-dom'; import axios from 'axios'; -function EntryGame() { +function EntryGame({ accessToken }) { const history = useHistory(); const handleUrl = async () => { - console.log('test'); - const result = await axios.post('http://localhost:4000/room/join', {}); - history.push(`/room/${result.data}`); + const result = await axios.post( + 'http://localhost:4000/room/join', + {}, + { + headers: { + 'Content-Type': 'application/json', + authorization: accessToken.accessToken, + }, + Credentials: 'include', + } + ); + history.push(`/room/${result.data.data}`); }; return (