Skip to content

web-security. Pochtalon#664

Open
pochtalon wants to merge 2 commits into
mate-academy:masterfrom
pochtalon:pochtalon
Open

web-security. Pochtalon#664
pochtalon wants to merge 2 commits into
mate-academy:masterfrom
pochtalon:pochtalon

Conversation

@pochtalon
Copy link
Copy Markdown

Solved?

Copy link
Copy Markdown

@kozhukhovsky kozhukhovsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also need to add login and password pulling to CarDao, where we get all the drivers in the car

Driver driver = authenticationService.login(login, password);
HttpSession session = req.getSession();
session.setAttribute("driver_id", driver.getId());
resp.sendRedirect("/index");
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
req.getSession().invalidate();
resp.sendRedirect("/login");
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

public interface AuthenticationService {
Driver login(String driverName, String licenseNumber) throws AuthenticationException;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

return;
}
if (driverId == null) {
response.sendRedirect("/login");
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

contextPath

Added req.getContextPath() to controllers and AuthenticationFilter class;
Remove redundant line from AuthenticationService interface.
@pochtalon pochtalon requested a review from kozhukhovsky July 17, 2023 18:35
Copy link
Copy Markdown

@kozhukhovsky kozhukhovsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants