Skip to content

Commit 8e6cfe6

Browse files
committed
Change error message
1 parent dfa2313 commit 8e6cfe6

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

backend/user-service/controller/auth-controller.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,19 @@ import { formatUserResponse } from "./user-controller.js";
44
import { jwtConfig, REFRESH_TOKEN_COOKIE_KEY, refreshTokenCookieOptions } from "../config/authConfig.js";
55
import TokenService from "../services/tokenService.js";
66
import { BadRequestError, NotFoundError, UnauthorisedError } from "../utils/httpErrors.js";
7-
import { decode } from "jsonwebtoken";
87

98
export async function handleLogin(req, res, next) {
109
const { email, password } = req.body;
1110
if (email && password) {
1211
try {
1312
const user = await _findUserByEmail(email);
1413
if (!user) {
15-
throw new UnauthorisedError("Wrong email");
14+
throw new UnauthorisedError("Wrong email/password");
1615
}
1716

1817
const match = await bcrypt.compare(password, user.password);
1918
if (!match) {
20-
throw new UnauthorisedError("Wrong password");
19+
throw new UnauthorisedError("Wrong email/password");
2120
}
2221

2322
// Generate access and refresh token

0 commit comments

Comments
 (0)