Skip to content

Commit

Permalink
hoxfix token
Browse files Browse the repository at this point in the history
  • Loading branch information
cjs1301 committed May 6, 2021
1 parent 5bce5ae commit cfbb660
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ export default function App() {
//return this.setState({ email: message, createdAt: message });
}
const { nickname, email, profile_image } = res.data.data.userInfo;
console.log(res.data.data.accessToken)
setAccessToken({accessToken:res.data.data.accessToken})
setUserInfo({
nickname: nickname,
email: email,
Expand Down Expand Up @@ -124,6 +126,7 @@ export default function App() {
};
return (
<div>
<button onClick={refreshTokenRequest}>리프레쉬 토큰</button>
<Switch>
<Route
path="/Waiting"
Expand Down
2 changes: 1 addition & 1 deletion src/MainPages/components/Signin.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default function Signin({ isOpen, close, loginHandler }) {
{ email, password },
{
headers: { 'Content-Type': 'application/json' },
Credentials: 'include',
withCredentials: true,
}
)
.then((res) => {
Expand Down
6 changes: 6 additions & 0 deletions src/MyPages/MyPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import Character1 from '../images/Character1.png';
import Character2 from '../images/Character2.png';
import Character3 from '../images/Character3.png';
import Character4 from '../images/Character4.png';
import axios from 'axios';

function MyPage({ accessToken, isLogIn, loginCheck, userInfo }) {
const PhotoData = [Character1, Character2, Character3, Character4];
Expand Down Expand Up @@ -58,6 +59,11 @@ function MyPage({ accessToken, isLogIn, loginCheck, userInfo }) {
headers: { 'Content-Type': 'application/json' },
Credentials: 'include',
})
const SaveComment = await axios.post(`http://localhost:4000/mypage/${id}/comment`,
{
authorization: accessToken,
Comment: PhotoNum
})
}


Expand Down

0 comments on commit cfbb660

Please sign in to comment.