Skip to content
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

Merged
merged 7 commits into from
Dec 9, 2020
Merged

Bugs fix #658

merged 7 commits into from
Dec 9, 2020

Conversation

lazycipher
Copy link

@lazycipher lazycipher commented Nov 27, 2020

Fix various issues/bugs reported on this repo.
#650 #659 #637 #635 #614 #614 #552 #660

@@ -0,0 +1,5 @@
import axios from "axios";

Copy link
Member

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?

Copy link
Author

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";
Copy link
Member

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

Copy link
Author

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()
Copy link
Member

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

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was already there!

Copy link
Author

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}`)
Copy link
Member

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

Copy link
Author

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.

@vaibhavdaren
Copy link
Member

@Rupeshiya please

@lazycipher lazycipher closed this Dec 9, 2020
@vaibhavdaren vaibhavdaren reopened this Dec 9, 2020
@vaibhavdaren vaibhavdaren merged commit cbfe525 into codeuino:development Dec 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants