Skip to content

Commit

Permalink
test: xss
Browse files Browse the repository at this point in the history
  • Loading branch information
OnlyNico43 committed Aug 21, 2024
1 parent 46233d3 commit 22155d3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/app/[locale]/profile/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
import { redirect } from 'next/navigation';
import { FunctionComponent, ReactElement } from 'react';
import { checkLogin } from '../actions';
import ProfileComponent from '@/src/components/test/Profile';

const Profile: FunctionComponent = async (): Promise<ReactElement> => {
const isLoggedIn = await checkLogin();
if (!isLoggedIn) {
redirect('/login');
}
return <div>Profile</div>;
return <ProfileComponent />;
};

export default Profile;
12 changes: 12 additions & 0 deletions src/components/test/Profile.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
'use client';

import { UserContext } from '@/src/providers/user-provider/UserProvider';
import { ReactElement, useContext } from 'react';

const ProfileComponent = (): ReactElement => {
const { user } = useContext(UserContext);
if (!user) return <></>;
return <div>{user.name}</div>;
};

export default ProfileComponent;

0 comments on commit 22155d3

Please sign in to comment.