|
3 | 3 | import com.google.gson.JsonObject; |
4 | 4 | import com.google.gson.JsonParseException; |
5 | 5 | import io.jsonwebtoken.ExpiredJwtException; |
| 6 | +import io.jsonwebtoken.MalformedJwtException; |
6 | 7 | import io.jsonwebtoken.security.SignatureException; |
7 | 8 | import io.netty.handler.codec.http.HttpResponseStatus; |
8 | 9 | import lombok.RequiredArgsConstructor; |
@@ -39,7 +40,7 @@ public ApiResponse login(@ApiParameter(id = "access_token") final String accessT |
39 | 40 | final JsonObject accessToken; |
40 | 41 | try { |
41 | 42 | accessToken = SecurityUtils.parseJwt(key, accessTokenJwt); |
42 | | - } catch (JsonParseException | SignatureException e) { |
| 43 | + } catch (JsonParseException | SignatureException | MalformedJwtException e) { |
43 | 44 | return new ApiResponse(HttpResponseStatus.UNAUTHORIZED, "INVALID_TOKEN"); |
44 | 45 | } catch (ExpiredJwtException e) { |
45 | 46 | return new ApiResponse(HttpResponseStatus.UNAUTHORIZED, "TOKEN_EXPIRED"); |
@@ -79,7 +80,7 @@ public ApiResponse register(@ApiParameter(id = "access_token") final String acce |
79 | 80 | final JsonObject accessToken; |
80 | 81 | try { |
81 | 82 | accessToken = SecurityUtils.parseJwt(key, accessTokenJwt); |
82 | | - } catch (JsonParseException | SignatureException e) { |
| 83 | + } catch (JsonParseException | SignatureException | MalformedJwtException e) { |
83 | 84 | return new ApiResponse(HttpResponseStatus.UNAUTHORIZED, "INVALID_TOKEN"); |
84 | 85 | } catch (ExpiredJwtException e) { |
85 | 86 | return new ApiResponse(HttpResponseStatus.UNAUTHORIZED, "TOKEN_EXPIRED"); |
|
0 commit comments