Organisation code avec commentaire

This commit is contained in:
Valentin CZERYBA 2022-05-15 17:08:00 +02:00
parent 1914022fda
commit 7aeb473d02

View File

@ -30,6 +30,18 @@ public class UsersRessources {
@Inject
JsonWebToken jwt;
///Function
private Boolean checkUserCookie(String userCookie, UsersEntity users){
String name = new String(Base64.decode(userCookie), StandardCharsets.UTF_8);
if(!name.equals(users.pseudo) && (!users.status)){
return false;
}
return true;
}
/// Appel HTTP
///GET
@GET
@RolesAllowed("Admin")
public Response getUsers(){
@ -73,11 +85,6 @@ public class UsersRessources {
}
return Response.ok(new UserSingle(user.name, user.pseudo, user.firstName)).build();
}
private Boolean checkUserCookie(String userCookie, UsersEntity users){
String name = new String(Base64.decode(userCookie), StandardCharsets.UTF_8);
if(!name.equals(users.pseudo) && (!users.status)){
return false;
}
return true;
}
}