Skip to content

Commit

Permalink
[#66] Set userID
Browse files Browse the repository at this point in the history
  • Loading branch information
dewy-i committed Aug 9, 2021
1 parent 4c7b294 commit 2fdcf47
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/views/login/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Button, Box, makeStyles, Container, Typography, Link } from '@material-
import Loading from '@components/Loading';
import UosInput from '@components/UosInput';
import { semesterState } from '@states/Semester';
import { API_LOGIN, API_GET_SEMESTER, requestAPI, getToken, setToken } from '@utils/api';
import { API_LOGIN, API_GET_SEMESTER, requestAPI, getToken, setToken, removeUserID, setUserID } from '@utils/api';
import { foregroundColor } from '@utils/styles/Colors';
import useLogoLayoutStyles from '@utils/styles/login/LogoLayout';
import useLoginLabelStyles from '@utils/styles/login/LoginLabel';
Expand Down Expand Up @@ -86,6 +86,7 @@ export function LoginBox() {
}

setToken(response.data.token);
setUserID(response.data.userId);
await callSemester();
getSocket();
setLoading(false);
Expand Down Expand Up @@ -127,6 +128,7 @@ export function LoginBox() {
window.location.reload();
return null;
}
removeUserID();

return (
<Container className={classes.container}>
Expand Down

0 comments on commit 2fdcf47

Please sign in to comment.