forked from RyanGoodwill/backend
Merge branch 'main' into personal/heshunme/auth-restart-1
This commit is contained in:
commit
3137c22313
@ -0,0 +1,15 @@
|
|||||||
|
package org.cmh.backend.Utils;
|
||||||
|
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.ControllerAdvice;
|
||||||
|
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||||
|
|
||||||
|
@ControllerAdvice
|
||||||
|
public class GlobalExceptionHandler {
|
||||||
|
|
||||||
|
@ExceptionHandler(JwtValidationException.class)
|
||||||
|
public ResponseEntity<Object> handleJwtInvalidException(JwtValidationException ex) {
|
||||||
|
return new ResponseEntity<>(HttpStatus.UNAUTHORIZED);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user