LeNelSoN / you-are-the-hero

L'API dont vous êtes le héros is an interactive Java API that brings the adventure of "choose your own adventure" stories to life. Users can embark on unique journeys, make decisions at each step, and create dynamic narratives, all while experiencing the nostalgia of classic adventure books.
GNU General Public License v3.0
2 stars 10 forks source link

fix(jwtutil): changing extractAllClaims method #20

Closed LeNelSoN closed 2 months ago

LeNelSoN commented 2 months ago

Context:

This PR aims to fix an issue (Fixes #19) that arose after updating dependencies, particularly the jjwt library. The previous implementation of the extractAllClaims method in the JwtUtil class was no longer functional.

Changes Made:

I replaced the old extractAllClaims method with a new implementation to ensure compatibility with the latest versions of the jjwt library. Here’s the new method:

private Claims extractAllClaims(String token) {
    return Jwts.parser()
            .verifyWith(Keys.hmacShaKeyFor(SECRET_KEY.getBytes(StandardCharsets.UTF_8)))
            .build().parseSignedClaims(token)
            .getPayload();
}