Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions SK.WebApp/src/getLoggedUser.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

export type GetLoggedUserResponse = {
username: string;
token: string;
image: string;
};

export const getLoggedUser = async (): Promise<GetLoggedUserResponse | undefined> => {

try {
const response = await fetch(`localhost:5001/${navigator.language}/api/User`, {
method: 'GET',
mode: 'cors',
headers: {
'Content-Type': 'application/json',
},
});

return response.json();
} catch (error) {
console.warn('Login was failed.', error);
}
};
1 change: 1 addition & 0 deletions SK.WebApp/src/pages/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
import { useInterval } from '../hooks/useInterval';
import { DefaultLayout } from '../components/Layout/DefaultLayout';
import { Typography } from '../components/Typography/Typography';
import { userRegister } from '../userRegister';

export const Home = () => {
const dispatch = useAppDispatch();
Expand Down
8 changes: 8 additions & 0 deletions workspace.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"folders": [
{
"path": "."
}
],
"settings": {}
}