Remove session requirement from web /auth/ request.

This commit is contained in:
James Quinley 2023-02-11 22:23:52 -08:00
parent a6d2694517
commit 6c67ea6fa0

View File

@ -1835,7 +1835,17 @@ public class delegationServices {
System.out.println("Login Request (USR&PASS)");
String username = (String) Lrequest.get("user");
String password = (String) Lrequest.get("password");
String session = (String) Lrequest.get("sessionID");
String session;
String sourcet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
StringBuilder sbt = new StringBuilder();
Random srandom = new Random();
int sidl = 100;
for (int i = 0; i < sidl; i++) {
int index = srandom.nextInt(sourcet.length());
char randomChar = sourcet.charAt(index);
sbt.append(randomChar);
}
session = sbt.toString();
Object objid = Lrequest.get("_id");
System.out.println(objid);
Document accountServer;
@ -1927,6 +1937,7 @@ public class delegationServices {
BasicDBObject updateQuery6 = new BasicDBObject();
BasicDBObject updateQuery7 = new BasicDBObject();
BasicDBObject updateQuery8 = new BasicDBObject();
BasicDBObject updateQuery9 = new BasicDBObject();
BasicDBObject updateQueryAD = new BasicDBObject();
updateQuery.append("$set",
new BasicDBObject().append("type", 8));
@ -1944,6 +1955,8 @@ public class delegationServices {
new BasicDBObject().append("status", true));
updateQuery8.append("$set",
new BasicDBObject().append("keychainUUID", keychainUUID));
updateQuery9.append("$set",
new BasicDBObject().append("session", session));
updateQueryAD.append("$set",
new BasicDBObject().append("websession", session));
System.out.println("3");
@ -1952,9 +1965,10 @@ public class delegationServices {
dCollection.updateOne(searchQuery, updateQuery2);
dCollection.updateOne(searchQuery, updateQuery3);
dCollection.updateOne(searchQuery, updateQuery4);
dCollection.updateOne(searchQuery, updateQuery6);
dCollection.updateOne(searchQuery, updateQuery9);
dCollection.updateOne(searchQuery, updateQuery7);
dCollection.updateOne(searchQuery, updateQuery8);
dCollection.updateOne(searchQuery, updateQuery6);
accountS.updateOne(searchQueryAD,updateQueryAD);
/*The last update allows the server to add the current authed web session, home page
will verify session staus, if it is invalid the user will be pushed to create a new session.