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

Suppression des System out

parent c25cfce5
No related branches found
No related tags found
No related merge requests found
...@@ -24,13 +24,10 @@ public class APIRest extends HttpServlet { ...@@ -24,13 +24,10 @@ public class APIRest extends HttpServlet {
if (authorization == null || !authorization.startsWith("Bearer")) { if (authorization == null || !authorization.startsWith("Bearer")) {
return false; return false;
} }
System.out.println("Authorization Header: " + authorization);
String token = authorization.substring("Bearer".length()).trim(); String token = authorization.substring("Bearer".length()).trim();
try { try {
Claims claims = JwtManager.decodeJWT(token); 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()); req.setAttribute("login", claims.getSubject());
return true; return true;
} catch (Exception e) { } catch (Exception e) {
......
...@@ -43,19 +43,4 @@ public class JwtManager { ...@@ -43,19 +43,4 @@ public class JwtManager {
return claims; 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 { ...@@ -17,7 +17,7 @@ public class DS {
this.login = ConfigLoader.getProperty("login"); this.login = ConfigLoader.getProperty("login");
this.password = ConfigLoader.getProperty("mdp"); this.password = ConfigLoader.getProperty("mdp");
} catch (Exception e) { } catch (Exception e) {
System.out.println(e.getMessage()); System.err.println(e.getMessage());
} }
} }
...@@ -26,7 +26,7 @@ public class DS { ...@@ -26,7 +26,7 @@ public class DS {
Connection con = DriverManager.getConnection(url, login, password); Connection con = DriverManager.getConnection(url, login, password);
return con; return con;
} catch (Exception e) { } 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; return null;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment