Skip to content

Solution of this task#677

Open
IvanovYurii wants to merge 3 commits into
mate-academy:masterfrom
IvanovYurii:hw-jv-web-security
Open

Solution of this task#677
IvanovYurii wants to merge 3 commits into
mate-academy:masterfrom
IvanovYurii:hw-jv-web-security

Conversation

@IvanovYurii
Copy link
Copy Markdown

No description provided.

import taxi.service.AuthenticationServiceImpl;

public class LoginController extends HttpServlet {
private final AuthenticationService authenticationService = new AuthenticationServiceImpl();
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Use the Injector to initialize services

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.

fix it everywhere

Suggested change
resp.sendRedirect("/index");
resp.sendRedirect(req.getContextPath() + "/index");
Знімок екрана 2023-08-13 о 12 23 17

Fix resp.sendRedirect("/index")
Remove unused variable in LogoutController.java
Rename same inscriptions in HTML
@IvanovYurii IvanovYurii requested a review from Ivan95kos August 13, 2023 10:05
Copy link
Copy Markdown

@Ivan95kos Ivan95kos left a comment

Choose a reason for hiding this comment

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

Great job, with minor comments

@@ -27,9 +29,30 @@ public void doGet(HttpServletRequest req, HttpServletResponse resp)
public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

A lot of try-catch, return the previous version

… lot of try-catch, return the previous version)
@IvanovYurii IvanovYurii requested a review from Ivan95kos August 13, 2023 20:11
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.

3 participants