Conversation
| @@ -0,0 +1,5 @@ | |||
| import axios from "axios"; | |||
|
|
|||
There was a problem hiding this comment.
@lazycipher now you are not using authorization header ?
Only sending cookie?
There was a problem hiding this comment.
Yes after shifting the auth method to use cookies, we're using auth in the cookie header.
| import { Provider } from "react-redux"; | ||
| import store from "./store"; | ||
| import jwt_decode from "jwt-decode"; | ||
| import { setAuthToken } from "./utils/setAuthToken"; |
There was a problem hiding this comment.
if authorization is not required in header, remove the function too instead of just removing from here
| function App() { | ||
| useEffect(() => { | ||
| ReactGA.initialize("UA-173245995-1"); | ||
| setAuthToken() |
There was a problem hiding this comment.
Should I make it work as componentDidMount?
| localStorage.setItem("jwtToken", (token)); | ||
| setAuthToken(token); | ||
| // update localStorage with admin status | ||
| localStorage.setItem('username', `${res.data.user.name.firstName} ${res.data.user.name.lastName}`) |
There was a problem hiding this comment.
Local storage is not that secure!!
Try to come up with some secure approach!!
As of now, you can go with it but it's not acceptable at the production level
There was a problem hiding this comment.
Setting names in local storage won't do any harm as the protected resources sent from the server need that token in cookie.
|
@Rupeshiya please |
Fix various issues/bugs reported on this repo.
#650 #659 #637 #635 #614 #614 #552 #660