Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Проверять логин и пароль перед каждой командой #2

Closed
AlphaBeth opened this issue Sep 25, 2021 · 1 comment

Comments

@AlphaBeth
Copy link

Сейчас сервер верит клиенту - если он прислал логин, то пароль проверили когда-то раньше. Это правда лишь для вашего клиента, но в целом - нет, так как можно поменять клиент таким образом, чтобы он не проверял пароль.

@dmittrey
Copy link
Owner

dmittrey commented Oct 1, 2021

public Response execute(Request aRequest) {
String aCommand = aRequest.getCommand().getCommand();
String username = aRequest.getSession().getName();
String password = aRequest.getSession().getPassword();
if (aCommand.equals("register") || receiver.loginUser(username, password)) {
return commands.get(aCommand).execute(aRequest);
} else return new Response(TypeOfAnswer.NOTMATCH);
}

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

No branches or pull requests

2 participants