Skip to content

Commit

Permalink
refactor-krishnaacharyaa#429: Removed token saving in localstorage fo…
Browse files Browse the repository at this point in the history
…r Google OAuth
  • Loading branch information
siddharthisrani committed Jul 23, 2024
1 parent 558ffed commit 72e43f3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions frontend/src/pages/signin-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ function signin() {
if (isGoogleCallback && !toastShownRef.current) {
try {
const response = await axiosInstance.get('/api/auth/check');
const { token, user } = response.data;
localStorage.setItem('token', token);
const { user } = response.data;
if (user && user._id && user.role) {
userState.setUser({ _id: user._id, role: user.role });
navigate('/');
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/pages/signup-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ function Signup() {
if (isGoogleCallback && !toastShownRef.current) {
try {
const response = await axiosInstance.get('/api/auth/check');
const { token, user } = response.data;
localStorage.setItem('token', token);
const { user } = response.data;
if (user && user._id && user.role) {
userState.setUser({ _id: user._id, role: user.role });
navigate('/');
Expand Down

0 comments on commit 72e43f3

Please sign in to comment.