Skip to content

Commit

Permalink
fix: #569
Browse files Browse the repository at this point in the history
  • Loading branch information
ldeluigi committed Nov 5, 2024
1 parent d94b26b commit 73d30df
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/layout/UserDropdown/UserDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import CookieService from '../../../services/cookie.service';
import Link from 'next/link';

const UserDropdown: React.FC = () => {
const [cookies, _setCookies] = useCookies(['csbUsername', 'csbJwt', 'csbIsStaff']);
const [cookies, _setCookies] = useCookies(['csbUsername', 'csbIsStaff']);
const [username, setUsername] = useState('');

useEffect(() => {
if (cookies.csbJwt && cookies.csbUsername) {
if (cookies.csbUsername) {
setUsername(cookies.csbUsername);
}
}, []);
Expand Down
1 change: 1 addition & 0 deletions src/services/cookie.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export function logout() {
remove('csbJwt');
remove('csbUsername');
remove('csbUserId');
remove('csbIsStaff');
}

export function serverLogout(ctx: NextPageContext) {
Expand Down

0 comments on commit 73d30df

Please sign in to comment.