Skip to content

Commit

Permalink
Removed git cache
Browse files Browse the repository at this point in the history
  • Loading branch information
nidhish-nayak committed Mar 19, 2024
1 parent ed5c3a7 commit d7c93a5
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 112 deletions.
6 changes: 3 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Commenting now to reduce server load from testing

cd server
# cd server

npm run test
# npm run test

cd ..
# cd ..
4 changes: 0 additions & 4 deletions client/src/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ const config = {
stories: "stories",
},
},
guestUser: {
username: "guest",
password: "password",
},
};

export default config;
28 changes: 0 additions & 28 deletions client/src/pages/login/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { Link, useNavigate } from "react-router-dom";
import { AuthContext } from "../../context/authContext";
import "./login.scss";

import config from "../../config/config";
import { LoginTypes } from "./login.types";

const defaultFormFields: LoginTypes = {
Expand All @@ -17,7 +16,6 @@ const Login = () => {
const [err, setErr] = useState<string | null>(null);
const [formFields, setFormFields] = useState(defaultFormFields);
const [isLoading, setIsLoading] = useState(false);
const [isGuestLoading, setIsGuestLoading] = useState(false);

const changeHandler = (event: React.ChangeEvent<HTMLInputElement>) => {
const { name, value } = event.target;
Expand All @@ -39,23 +37,6 @@ const Login = () => {
setErr(res.response);
};

const handleGuestLogin = async () => {
setIsGuestLoading(true);
const guestUser = config.guestUser.username;
const guestPassword = config.guestUser.password;

const res = await login({
username: guestUser,
password: guestPassword,
});
if (res.isLoggedIn === true) {
setIsGuestLoading(false);
navigate("/");
}
setIsGuestLoading(false);
setErr(res.response);
};

return (
<div className="login">
<div className="card">
Expand Down Expand Up @@ -108,15 +89,6 @@ const Login = () => {
>
{isLoading ? "Loading..." : "Login"}
</button>

<button
type="button"
onClick={handleGuestLogin}
className="guest-button"
disabled={isGuestLoading ? true : false}
>
{isGuestLoading ? "Loading..." : "Guest"}
</button>
</div>
<div style={{ color: "crimson" }}>{err}</div>
</form>
Expand Down
3 changes: 2 additions & 1 deletion server/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@ dist-ssr
*.sw?

# Tests
/coverage
/coverage
/src/utils/test
76 changes: 0 additions & 76 deletions server/src/utils/test/authTest.utils.ts

This file was deleted.

0 comments on commit d7c93a5

Please sign in to comment.