Skip to content

Commit

Permalink
Open-Set-Go v1.0.1 (#87)
Browse files Browse the repository at this point in the history
* Feat : add meta data #65

Signed-off-by: bentshrimp <bent_shrimp@kookmin.ac.kr>

* Bump @adobe/css-tools from 4.2.0 to 4.3.1

Bumps [@adobe/css-tools](https://github.com/adobe/css-tools) from 4.2.0 to 4.3.1.
- [Changelog](https://github.com/adobe/css-tools/blob/main/History.md)
- [Commits](https://github.com/adobe/css-tools/commits)

---
updated-dependencies:
- dependency-name: "@adobe/css-tools"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fix : Security Priblem occured by nth-check resolved at #71

Signed-off-by: ymw0407 <yunminwo1211@gmail.com>

* Update : rename title from "Open Set Go" to "Open-Set-Go" #65

Signed-off-by: bentshrimp <bent_shrimp@kookmin.ac.kr>

* Update : manifest.json updated with proper icon images #65

Signed-off-by: bentshrimp <bent_shrimp@kookmin.ac.kr>

* Remove : unnecessary file, favicon.svg removed #65

Signed-off-by: bentshrimp <bent_shrimp@kookmin.ac.kr>

* Fix : icon size setting fixed #65

Signed-off-by: bentshrimp <bent_shrimp@kookmin.ac.kr>

* Chore : remove .vscode

Signed-off-by: Yun Min Woo <yunminwo1211@gmail.com>

* Add : _redirects for netlify CD

Signed-off-by: Yun Min Woo <yunminwo1211@gmail.com>

* Fix : Improving cookie handling tech #78

- need to improve handling cookie at refreshing main page

* Fix : vulnerability alert resolved  #77

- https://github.com/AgainIoT/Open-Set-Go_client/security/dependabot/3

Signed-off-by: bentshrimp <bent_shrimp@kookmin.ac.kr>

* Fix : MainPage isLogin state works well  #78

Signed-off-by: bentshrimp <bent_shrimp@kookmin.ac.kr>

* Fix : changed unnecessary if-else into single return statement #78

Signed-off-by: bentshrimp <bent_shrimp@kookmin.ac.kr>

* update staging branch (#81)

* Fix : Improving cookie handling tech #78

- need to improve handling cookie at refreshing main page

* Fix : vulnerability alert resolved  #77

- https://github.com/AgainIoT/Open-Set-Go_client/security/dependabot/3

Signed-off-by: bentshrimp <bent_shrimp@kookmin.ac.kr>

* Fix : MainPage isLogin state works well  #78

Signed-off-by: bentshrimp <bent_shrimp@kookmin.ac.kr>

* Fix : changed unnecessary if-else into single return statement #78

Signed-off-by: bentshrimp <bent_shrimp@kookmin.ac.kr>

---------

Signed-off-by: bentshrimp <bent_shrimp@kookmin.ac.kr>
Co-authored-by: ymw0407 <yunminwo1211@gmail.com>

* Fix : remove user info in local storage  #83

- correct the icon src
- remove user info every time user revisit after automatic loggout

Signed-off-by: bentshrimp <bent_shrimp@kookmin.ac.kr>

* Add : add react script 'yarn start:win' & 'yarn start:linux' #85

* Feat : Security Policy Updated #87

Signed-off-by: Yun Min Woo <yunminwo1211@gmail.com>

* Fix : blog -> docs, docs domain changed #88

* Fix : Logo.svg changed to logo.svg(typo error)

Co-authored-by : bent_shrimp <bent_shrimp@kookmin.ac.kr>

Signed-off-by: Yun Min Woo <yunminwo1211@gmail.com>

* Fix : render profile image when only login #83

Signed-off-by: bentshrimp <bent_shrimp@kookmin.ac.kr>

* Chore : remove unnecessary import #83

Signed-off-by: bentshrimp <bent_shrimp@kookmin.ac.kr>

* Revert "Unexpected bugs fixed"

* Fix : manage login state only in Header #83

Signed-off-by: bentshrimp <bent_shrimp@kookmin.ac.kr>

* Chore : remove unused state variable #83

Signed-off-by: bentshrimp <bent_shrimp@kookmin.ac.kr>

* Correct old docs url (#100)

Fix : old docs url corrected #98

Signed-off-by: bentshrimp <bent_shrimp@kookmin.ac.kr>
Co-authored-by: Yun Min Woo <yunminwo1211@gmail.com>

---------

Signed-off-by: bentshrimp <bent_shrimp@kookmin.ac.kr>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: ymw0407 <yunminwo1211@gmail.com>
Signed-off-by: Yun Min Woo <yunminwo1211@gmail.com>
Co-authored-by: bentshrimp <bent_shrimp@kookmin.ac.kr>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: bent_shrimp <39232867+bentshrimp@users.noreply.github.com>
  • Loading branch information
4 people authored Oct 7, 2023
1 parent 3ec628e commit bc30a25
Show file tree
Hide file tree
Showing 20 changed files with 110 additions and 250 deletions.
3 changes: 0 additions & 3 deletions .vscode/settings.json

This file was deleted.

2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Welcome to Open-Set-Go contributing guide

Thank you for investing your time in contributing to our Open-Set-Go project! Any contribution you make will be reflected on [Open-Set-Go.io](https://open-set-go.netlify.app/) & [README.md](https://github.com/AgainIoT/Open-Set-Go#contributors) ✨.
Thank you for investing your time in contributing to our Open-Set-Go project! Any contribution you make will be reflected on [Open-Set-Go.io](https://docs.open-set-go.com) & [README.md](https://github.com/AgainIoT/Open-Set-Go#contributors) ✨.

We are committed to fostering a contribution-friendly environment that encourages contributions and aims to evolve into an open-source community. Please have a lot of conversations on [our Discussion](https://github.com/AgainIoT/Open-Set-Go/discussions)!

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Open-Set-Go_client

<p align="center">
<a href="https://open-set-go.netlify.app/" target="blank"><img src="https://github.com/AgainIoT/Open-Set-Go/raw/main/.github/images/Open-Set-Go.png" width="200" alt="Open-Set-Go Logo" /></a>
<a href="https://docs.open-set-go.com/" target="blank"><img src="https://github.com/AgainIoT/Open-Set-Go/raw/main/.github/images/Open-Set-Go.png" width="200" alt="Open-Set-Go Logo" /></a>
</p>

<p align="center">
Start Open-Source Projects easily, quickly and conveniently with <a href="https://open-set-go.netlify.app/" target="blank">Open-Set-Go</a>!
Start Open-Source Projects easily, quickly and conveniently with <a href="https://docs.open-set-go.com/" target="blank">Open-Set-Go</a>!
</p>

<p align="center">
Expand Down Expand Up @@ -119,7 +119,7 @@ Open-Set-Go makes it easy, fast and simple to start an Open-Source project, whil

We are conducting documentation at Open-Set-Go.io. Please refer to the following. _You can see our technical blog & showcase on Open-Set-Go.io_

- <a href="https://open-set-go.netlify.app/">Open-Set-Go.io</a>
- <a href="https://docs.open-set-go.com/">Open-Set-Go.io</a>

## Contributing

Expand Down
13 changes: 9 additions & 4 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@

## Supported Versions

Use this section to tell people about which versions of your project are
currently being supported with security updates.

| Version | Supported |
| ------- | ------------------ |
| 0.0.x | :white_check_mark: |
| 0.0.x ||
| 1.0.0 ||
| 1.0.1 | ☑️ |

## Reporting a Vulnerability

We strongly encourage you to report security vulnerabilities to
our private security mailing list: yunminwo1211@gmail.com - first, before
disclosing them in any public forums.
11 changes: 9 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
"@mui/material": "^5.14.8",
"@mui/styled-engine-sc": "^5.14.8",
"@mui/x-data-grid": "^6.12.0",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/jest-dom": "^6.1.3",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"@uiw/react-markdown-preview": "^4.1.15",
"@uiw/react-md-editor": "^3.23.5",
"axios": "^1.5.0",
"env-cmd": "^10.1.0",
"prop-types": "^15.8.1",
"react": "^18.2.0",
"react-cookie": "^6.1.0",
"react-dom": "^18.2.0",
"react-modal": "^3.16.1",
"react-query": "^3.39.3",
Expand All @@ -39,6 +39,9 @@
},
"scripts": {
"start": "react-scripts start",
"start:win": "set HTTPS=true&&react-scripts start",
"start:linux": "HTTPS=true react-scripts start",
"start:dev": "env-cmd -f .env.development.local react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
Expand Down Expand Up @@ -71,5 +74,9 @@
"eslint-plugin-react": "^7.33.1",
"eslint-plugin-react-hooks": "^4.3.0",
"prettier": "3.0.1"
},
"resolutions": {
"nth-check": "^2.1.1",
"postcss": "^8.4.31"
}
}
Binary file removed public/favicon.ico
Binary file not shown.
4 changes: 2 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<link rel="icon" href="%PUBLIC_URL%/logo.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
Expand All @@ -24,7 +24,7 @@
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>Open-Set-Go</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
Binary file added public/logo.ico
Binary file not shown.
3 changes: 3 additions & 0 deletions public/logo.svg
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 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 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.
8 changes: 4 additions & 4 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"short_name": "Open-Set-Go",
"name": "Open Set Go",
"icons": [
{
"src": "favicon.ico",
"src": "logo.svg",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
Expand All @@ -13,7 +13,7 @@
"sizes": "192x192"
},
{
"src": "logo512.png",
"src": "Logo512.png",
"type": "image/png",
"sizes": "512x512"
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/main/Footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default function Footer() {
</InfoDiv>
<VlineDiv />
<GithubDiv>
<a href="https://open-set-go.netlify.app/">
<a href="https://docs.open-set-go.com/">
<DocsP>DOCS</DocsP>
</a>
<a href="https://github.com/AgainIoT/Open-Set-Go">
Expand Down
12 changes: 8 additions & 4 deletions src/components/main/Welcome.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Stack from "@mui/material/Stack";
import { Button } from "@mui/material";
import propTypes from "prop-types";
import { useRecoilValue } from "recoil";
import { token } from "../../recoil/authorize";
import { isLogin } from "../../recoil/authorize";
import { useNavigate } from "react-router-dom";
import styled from "styled-components";
import { COLOR } from "../../styles/color.js";
Expand All @@ -14,7 +14,7 @@ const handleLogin = () => {
window.location.href = githubURL;
};
export const Welcome = (ref) => {
const accessToken = useRecoilValue(token);
const Logined = useRecoilValue(isLogin);
const navigate = new useNavigate();
return (
<StWelcome>
Expand All @@ -31,7 +31,7 @@ export const Welcome = (ref) => {
>
learn more
</LearnmoreBtn>
{accessToken ? (
{Logined === true ? (
<LoginBtn variant="contained" onClick={() => navigate("/step1")}>
get started
</LoginBtn>
Expand All @@ -57,7 +57,11 @@ const StWelcome = styled.div`
text-align: center;
justify-content: center;
height: 80vh;
background: linear-gradient(to bottom, ${COLOR.MAIN_HOVER}, ${COLOR.MAIN_BACKGROUND});
background: linear-gradient(
to bottom,
${COLOR.MAIN_HOVER},
${COLOR.MAIN_BACKGROUND}
);
`;

export const Title = styled.h1`
Expand Down
1 change: 0 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React from "react";
import ReactDOM from "react-dom/client";
import "./index.css";
import App from "./App";
import { CookiesProvider } from "react-cookie";
import reportWebVitals from "./reportWebVitals";
import { RecoilRoot, RecoilEnv } from "recoil";

Expand Down
44 changes: 36 additions & 8 deletions src/layout/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ import MenuIcon from "@mui/icons-material/Menu";
import LOGO from "../../src/assets/images/Logo.svg";
import axios from "axios";
import { useRecoilState, useSetRecoilState } from "recoil";
import { avatar, id, name, token } from "../recoil/authorize";
import { avatar, id, name, isLogin } from "../recoil/authorize";
import styled from "styled-components";

const ElevationScroll = (props) => {
const { children, window } = props;
// Note that you normally won't need to set the window ref as useScrollTrigger
Expand All @@ -42,17 +43,44 @@ ElevationScroll.propTypes = {
*/
window: PropTypes.func,
};

async function checkTokenValid() {
const isTokenValid = await axios.get(
`${process.env.REACT_APP_SERVER_URL}/auth/checkToken`,
{
validateStatus: (status) => {
return status < 500;
},
withCredentials: true,
},
);
return isTokenValid.status < 400;
}

export const Header = (props) => {
const [anchorElNav, setAnchorElNav] = useState(null);
const [anchorElUser, setAnchorElUser] = useState(null);
const [src, setSrc] = useRecoilState(avatar);
const [userId, setUserId] = useRecoilState(id);
const [userName, setUserName] = useRecoilState(name);
const setToken = useSetRecoilState(token);
const setIsLogin = useSetRecoilState(isLogin);

const checkIsLogin = async () => {
const loggedIn = await checkTokenValid();
if (loggedIn) {
setSrc(localStorage.avatar);
setUserId(localStorage.id);
setUserName(localStorage.name);
} else {
localStorage.removeItem("id");
localStorage.removeItem("name");
localStorage.removeItem("avatar");
}
setIsLogin(loggedIn);
};

React.useEffect(() => {
setSrc(localStorage.avatar);
setUserId(localStorage.id);
setUserName(localStorage.name);
checkIsLogin();
}, []);
const handleOpenNavMenu = (event) => {
setAnchorElNav(event.currentTarget);
Expand All @@ -76,7 +104,7 @@ export const Header = (props) => {
"",
{ withCredentials: true },
);
setToken("");
setIsLogin(false);
localStorage.setItem("id", "guest");
localStorage.setItem("name", "guest");
localStorage.setItem("avatar", "");
Expand Down Expand Up @@ -160,7 +188,7 @@ export const Header = (props) => {
<MenuItem
key={"Docs"}
onClick={() =>
handleOpenNewTab("https://open-set-go.netlify.app/")
handleOpenNewTab("https://docs.open-set-go.com")
}
>
<Typography textAlign="center">Docs</Typography>
Expand Down Expand Up @@ -210,7 +238,7 @@ export const Header = (props) => {
<MenuItemWrapper
key="docs"
onClick={() =>
handleOpenNewTab("https://open-set-go.netlify.app/")
handleOpenNewTab("https://docs.open-set-go.com")
}
>
Docs
Expand Down
12 changes: 4 additions & 8 deletions src/pages/Login.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import { Title } from "../components/main/Welcome";
import { useNavigate } from "react-router-dom";
import { useEffect } from "react";
import { useSetRecoilState } from "recoil";
import { avatar, id, name, token } from "../recoil/authorize";
import { Cookies } from "react-cookie";
import { avatar, id, isLogin, name } from "../recoil/authorize";
import propTypes from "prop-types";

let cnt = 0;
Expand All @@ -16,8 +15,7 @@ function LoginPage() {
const setAvatar = useSetRecoilState(avatar);
const navigate = useNavigate();

const cookies = new Cookies();
const setToken = useSetRecoilState(token);
const setIsLogin = useSetRecoilState(isLogin);

const login = async () => {
if (!cnt++) {
Expand Down Expand Up @@ -58,15 +56,13 @@ function LoginPage() {
);
if (200 > res.status || res.status >= 300) {
alert("login failed");
setIsLogin(false);
} else {
const accessToken = cookies.get("Authentication");
setToken(accessToken);
setIsLogin(true);
}
};

useEffect(() => {
const accessToken = cookies.get("Authentication");
setToken(accessToken);
login();
navigate("/");
}, []);
Expand Down
15 changes: 1 addition & 14 deletions src/pages/MainPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,8 @@ import Footer from "../components/main/Footer";
import Steps from "../components/main/Steps";
import propTypes from "prop-types";
import { Header } from "../layout/Header";
import { Cookies } from "react-cookie";
import { useEffect } from "react";
import { useSetRecoilState } from "recoil";
import { token } from "../recoil/authorize";

function MainPage() {
const cookies = new Cookies();
const setAccessToken = useSetRecoilState(token);
useEffect(() => {
const accessToken = cookies.get("Authentication");
if (accessToken) {
setAccessToken(accessToken);
} else {
setAccessToken(null);
}
}, []);
return (
<>
<Header burger={true} pages={["Steps"]} settings={["Logout"]} />
Expand Down
6 changes: 3 additions & 3 deletions src/recoil/authorize.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { atom } from "recoil";

export const token = atom({
key: "token",
default: null,
export const isLogin = atom({
key: "isLogin",
default: false,
});

export const avatar = atom({
Expand Down
Loading

0 comments on commit bc30a25

Please sign in to comment.