Skip to content
Snippets Groups Projects
Commit 029bcb33 authored by Tom Dequesnes's avatar Tom Dequesnes
Browse files

Suppression des System out

parent c25cfce5
Branches
No related tags found
No related merge requests found
......@@ -24,13 +24,10 @@ public class APIRest extends HttpServlet {
if (authorization == null || !authorization.startsWith("Bearer")) {
return false;
}
System.out.println("Authorization Header: " + authorization);
String token = authorization.substring("Bearer".length()).trim();
try {
Claims claims = JwtManager.decodeJWT(token);
System.out.println("Token décodé : " + claims.toString());
System.out.println("Le login est : " + claims.getSubject());
req.setAttribute("login", claims.getSubject());
return true;
} catch (Exception e) {
......
......@@ -43,19 +43,4 @@ public class JwtManager {
return claims;
}
public static void main(String args[]) {
System.out.println(JwtManager.SECRET_KEY);
String token = JwtManager.createJWT("Toto");
System.out.println(token);
Claims claims = null;
try {
claims = JwtManager.decodeJWT(token);
} catch (Exception e) {
System.out.println("jeton invalide " + e.getMessage());
System.exit(1);
}
System.out.println(claims.toString());
}
}
......@@ -17,7 +17,7 @@ public class DS {
this.login = ConfigLoader.getProperty("login");
this.password = ConfigLoader.getProperty("mdp");
} catch (Exception e) {
System.out.println(e.getMessage());
System.err.println(e.getMessage());
}
}
......@@ -26,7 +26,7 @@ public class DS {
Connection con = DriverManager.getConnection(url, login, password);
return con;
} catch (Exception e) {
System.out.println("Il y a une erreur lors de la connection : " + e.getMessage());
System.err.println("Il y a une erreur lors de la connection : " + e.getMessage());
return null;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment