Skip to content

Commit 46e5dbf

Browse files
committed
Refactor - login error fixed, log statements removed, readme updated
1 parent f54490b commit 46e5dbf

File tree

5 files changed

+8
-21
lines changed

5 files changed

+8
-21
lines changed

client/src/components/movie-details/Form.tsx

-10
Original file line numberDiff line numberDiff line change
@@ -105,16 +105,6 @@ const Form = (props: FormProps) => {
105105
{errors.description?.message}
106106
</span>
107107
)}
108-
{errors && (
109-
<span className="text-xs font-semibold text-red-500">
110-
{errors.description?.message}
111-
{errors.id?.message}
112-
{errors.userId?.message}
113-
{errors.poster?.message}
114-
{errors.trailer?.message}
115-
{errors.title?.message}
116-
</span>
117-
)}
118108
</div>
119109
<Button
120110
data-testid="submit"

client/src/config/axios.ts

-3
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ api.interceptors.response.use(
2525
let message;
2626
let status;
2727
switch (error.response.status) {
28-
case 401: {
29-
throw new Error("Token Expired. Please login again.");
30-
}
3128
case 403: {
3229
throw new Error(
3330
"Forbidden: You do not have permission to access this resource.",

client/src/pages/Login.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,15 @@ export const Login = () => {
2828
const { email, password, remember } = data;
2929
try {
3030
const response = await authenticationUser({ email, password });
31+
alert(response);
3132
if (response) setLoading(false);
3233
localStorage.setItem("movie-night-token", response.token);
3334
remember
3435
? setSession({ ...response.user, token: response.token })
3536
: setSession({ ...response.user, token: "" });
3637
navigate("/");
3738
} catch (error) {
39+
alert(error);
3840
console.log(error);
3941
} finally {
4042
setLoading(false);

readme.md

+5-7
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ This application uses a variety of technologies in its stack:
3939
2. Create a `.env` file in the `server` directory with the following variables:
4040

4141
```env
42-
SALT=your_salt
43-
JWT_SECRET=your_jwt_secret
44-
DATABASE_URL=your_database_url
42+
SALT=
43+
JWT_SECRET=
44+
DATABASE_URL=
4545
```
4646
3. Build the Docker images:
4747

@@ -86,7 +86,7 @@ This application uses a variety of technologies in its stack:
8686

8787
## Usage
8888

89-
After starting the server and client, you can access the application at `http://localhost:3000`.
89+
After starting the server and client, you can access the application at `http://localhost:5173`.
9090

9191
## Testing
9292

@@ -135,6 +135,4 @@ npm run test:integration
135135
## License
136136

137137
This project is licensed under the [MIT License](LICENSE).
138-
```
139-
140-
Remember to replace `your_salt`, `your_jwt_secret`, and `your_database_url` with your actual values.
138+
```

server/prisma/seed.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function getMovies(): Array<Movie> {
5151
title: "Napoleon",
5252
poster:
5353
"https://upload.wikimedia.org/wikipedia/en/2/2e/Napoleon_Film_poster.jpg",
54-
trailer: "https://www.youtube.com/watch?v=uYPbbksJxIg",
54+
trailer: "https://www.youtube.com/watch?v=OAZWXUkrjPc",
5555
description:
5656
"A look at the military commander's origins and his swift, ruthless climb to emperor, viewed through the prism of his addictive and often volatile relationship with his wife and one true love, Josephine",
5757
},

0 commit comments

Comments
 (0)