user id to uuid
~15 min work
This commit is contained in:
parent
446b01d927
commit
872172cf76
@ -31,7 +31,7 @@ public final class SessionHandler {
|
|||||||
val result = DbQuery.builder()
|
val result = DbQuery.builder()
|
||||||
.command(SqlCommand.SELECT)
|
.command(SqlCommand.SELECT)
|
||||||
.table(Table.USERS)
|
.table(Table.USERS)
|
||||||
.column("id")
|
.column("uuid")
|
||||||
.column("password")
|
.column("password")
|
||||||
.column("admin")
|
.column("admin")
|
||||||
.condition("username", userCredentials.username())
|
.condition("username", userCredentials.username())
|
||||||
@ -48,7 +48,7 @@ public final class SessionHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
UUID uuid = UUID.randomUUID();
|
UUID uuid = UUID.randomUUID();
|
||||||
this.Sessions.put(uuid, new UserInfo((int) row1.get("id"), userCredentials.username(), (boolean) row1.get("admin")));
|
this.Sessions.put(uuid, new UserInfo((UUID) row1.get("uuid"), userCredentials.username(), (boolean) row1.get("admin")));
|
||||||
return uuid;
|
return uuid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
package at.nanopenguin.mtcg.application;
|
package at.nanopenguin.mtcg.application;
|
||||||
|
|
||||||
public record UserInfo(int id, String username, boolean admin) {
|
import java.util.UUID;
|
||||||
|
|
||||||
|
public record UserInfo(UUID id, String username, boolean admin) {
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user