Skip to content
This repository was archived by the owner on Apr 5, 2024. It is now read-only.
Merged
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
865 changes: 862 additions & 3 deletions webapp_frontend/package-lock.json

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion webapp_frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"@types/react-router-dom": "^5.1.6",
"axios": "^0.20.0",
"bootstrap": "^4.5.3",
"eslint-plugin-react-hooks": "^4.2.0",
"node-sass": "^4.14.1",
"react": "^16.13.1",
"react-bootstrap": "^1.4.0",
Expand All @@ -26,6 +27,7 @@
"react-toastify": "^6.1.0",
"redux": "^4.0.5",
"redux-types": "^2.0.3",
"super-tiny-icons": "^0.4.0",
"typescript": "^3.8.3"
},
"scripts": {
Expand All @@ -35,7 +37,7 @@
"eject": "react-scripts eject",
"storybook": "start-storybook -p 6006 -s public --no-dll",
"build-storybook": "build-storybook -s public --no-dll",
"sonar": "SONAR_LOGIN=$SONAR_LOGIN SONAR_PASSWORD=$SONAR_PASSWORD node src/sonar-scanner.js"
"sonar": "SONAR_LOGIN=$SONAR_LOGIN SONAR_PASSWORD=$SONAR_PASSWORD node src/sonar-scanner.js"
},
"eslintConfig": {
"extends": "react-app"
Expand Down
Binary file modified webapp_frontend/public/favicon.ico
Binary file not shown.
33 changes: 19 additions & 14 deletions webapp_frontend/public/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="en">
<html lang="en" class="h-100">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
Expand All @@ -24,20 +24,25 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<title>FileFighter</title>
</head>
<body>
<body class="h-100">
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.

You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.

To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
<div id="root" class="d-flex flex-column h-100"></div>
<!--Black Lives Matter!-->
<!--Queer Lives Matter!-->
<!-- ################### -->
<!-- ._____..._..._.........._____..._..........._......._................. -->
<!-- |..___|.(_).|.|...___..|..___|.(_)...____..|.|__...|.|_....___...____. -->
<!-- |.|_....|.|.|.|../._.\.|.|_....|.|../._\`|.|.'_.\..|.__|../._.\.|.'__| -->
<!-- |.._|...|.|.|.|.|..__/.|.._|...|.|.|.(_|.|.|.|.|.|.|.|_..|..__/.|.|... -->
<!-- |_|.....|_|.|_|..\___|.|_|.....|_|..\__,.|.|_|.|_|..\__|..\___|.|_|... -->
<!-- ------------------------------------|___/----------------------------- -->
<!-- FileFighter's documentation & code: https://filefighter.github.io/-->
<!-- ################### -->
<!-- Made with <3 by: -->
<!-- https://github.com/Gimleux -->
<!-- https://github.com/open-schnick -->
<!-- https://github.com/qvalentin -->
</body>
</html>
Binary file modified webapp_frontend/public/logo192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified webapp_frontend/public/logo512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified webapp_frontend/src/assets/images/logos/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions webapp_frontend/src/background/api/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ export const hostname:string =constants.url.API_URL+'/api';

export const userPath:string='/v1/users';

export const filesytemPath:string='/v1/filesystem';




interface BackendHealthData {
uptimeInSeconds: number;
Expand Down
12 changes: 11 additions & 1 deletion webapp_frontend/src/background/api/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const checkForCookie=()=>{
if (refreshTokenCookieValue){
store.dispatch(addRefreshToken(refreshTokenCookieValue))
getAccessTokenWithRefreshToken();

}
store.dispatch(checkedCookies(true))

Expand Down Expand Up @@ -78,22 +79,31 @@ export const getAccessTokenWithRefreshToken = () => {
},
};



Axios.get(hostname + userPath + '/auth', config)
.then((data) => {
setAuthHeaderToAxios(data.data.tokenValue)

store.dispatch(addAccessToken({token: data.data.tokenValue, timestamp: data.data.validUntil}as AccessToken));

//TODO: also get User data here


})
.catch(((error) => {
store.dispatch(removeTokens()as RemoveTokens);

console.log(error)
//you probably want to notify the user, maybe with a toast or similar

}));

}




export const logout=()=>{
store.dispatch(removeTokens());
deleteCookie(cookieName);
Expand All @@ -102,4 +112,4 @@ export const logout=()=>{
function setAuthHeaderToAxios(accessToken: string) {
Axios.defaults.headers.common['Authorization'] =
`Bearer ${accessToken}`;
}
}
Loading