Skip to content
Snippets Groups Projects
Commit d1268e61 authored by Boris's avatar Boris
Browse files

correction getByLoginPair

parent 3d3735fb
No related branches found
No related tags found
No related merge requests found
...@@ -24,7 +24,6 @@ public class StartServer { ...@@ -24,7 +24,6 @@ public class StartServer {
public static boolean verificationSession(spark.Request req) public static boolean verificationSession(spark.Request req)
{ {
String c = req.cookie("session-id"); String c = req.cookie("session-id");
System.out.println(c);
if (c == null) return false; if (c == null) return false;
else{ else{
...@@ -98,8 +97,10 @@ public class StartServer { ...@@ -98,8 +97,10 @@ public class StartServer {
String username = req.queryParams("userName"); String username = req.queryParams("userName");
String password = req.queryParams("password"); String password = req.queryParams("password");
//List<ProfEntity> profs = Core.Prof.getAll(); //List<ProfEntity> profs = Core.Prof.getAll();
ProfEntity found = Core.Prof.getByLoginPair(username, password); ProfEntity found = Core.Prof.getByLoginPair(username, password);
System.out.println(found);
if (found != null) { if (found != null) {
if (found.getPassword().compareTo(password) == 0) { if (found.getPassword().compareTo(password) == 0) {
connected = found; connected = found;
......
...@@ -28,7 +28,7 @@ public class ProfCore extends _DefaultCore<ProfEntity> { ...@@ -28,7 +28,7 @@ public class ProfCore extends _DefaultCore<ProfEntity> {
{ {
for(ProfEntity p : dao.getAll()) for(ProfEntity p : dao.getAll())
{ {
if(p.getUserName() == username && p.getPassword() == password) if(p.getUserName().compareTo(username) == 0 && p.getPassword().compareTo(password) == 0)
{ {
return p; return p;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment