nouveaux erreurs
This commit is contained in:
parent
da6a38f66e
commit
8625dd44e7
@ -64,7 +64,7 @@ public class UsersEntity extends PanacheEntityBase {
|
|||||||
users.name = name;
|
users.name = name;
|
||||||
users.firstName = firstName;
|
users.firstName = firstName;
|
||||||
users.birth = birth;
|
users.birth = birth;
|
||||||
users.status = false;
|
users.status = true;
|
||||||
users.password = Hash.encryptSHA512(password);
|
users.password = Hash.encryptSHA512(password);
|
||||||
users.roles = roles;
|
users.roles = roles;
|
||||||
users.created_at = LocalDateTime.now();
|
users.created_at = LocalDateTime.now();
|
||||||
|
@ -59,7 +59,10 @@ public class TokenRessource {
|
|||||||
return Response.status(Response.Status.NOT_FOUND).build();
|
return Response.status(Response.Status.NOT_FOUND).build();
|
||||||
}
|
}
|
||||||
if (jwtCookie == null) {
|
if (jwtCookie == null) {
|
||||||
if((!password.equals(users.password)) && (!users.status)) {
|
if(!password.equals(users.password)) {
|
||||||
|
return Response.status(Response.Status.NOT_ACCEPTABLE).build();
|
||||||
|
}
|
||||||
|
if(!users.status){
|
||||||
return Response.status(Response.Status.FORBIDDEN).build();
|
return Response.status(Response.Status.FORBIDDEN).build();
|
||||||
}
|
}
|
||||||
// Create a JWT token signed using the 'HS256' algorithm
|
// Create a JWT token signed using the 'HS256' algorithm
|
||||||
@ -74,7 +77,7 @@ public class TokenRessource {
|
|||||||
jwt = parser.parse(jwtCookie);
|
jwt = parser.parse(jwtCookie);
|
||||||
}
|
}
|
||||||
catch(ParseException p){
|
catch(ParseException p){
|
||||||
return Response.status(Response.Status.NOT_ACCEPTABLE).build();
|
return Response.status(Response.Status.GONE).build();
|
||||||
}
|
}
|
||||||
// or jwt = parser.decrypt(jwtCookie, secret);
|
// or jwt = parser.decrypt(jwtCookie, secret);
|
||||||
String kid = jwt.getClaim(Claims.kid).toString();
|
String kid = jwt.getClaim(Claims.kid).toString();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user