-
Notifications
You must be signed in to change notification settings - Fork 220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bugs fix #658
Bugs fix #658
Conversation
@@ -0,0 +1,5 @@ | |||
import axios from "axios"; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lazycipher now you are not using authorization header ?
Only sending cookie?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes after shifting the auth method to use cookies, we're using auth in the cookie header.
@@ -4,15 +4,17 @@ import "./App.css"; | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if authorization is not required in header, remove the function too instead of just removing from here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not understand.
function App() { | ||
useEffect(() => { | ||
ReactGA.initialize("UA-173245995-1"); | ||
setAuthToken() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might effect Analytics part cc @AuraOfDivinity
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was already there!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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