Organisation code avec commentaire
This commit is contained in:
parent
1914022fda
commit
7aeb473d02
@ -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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user