File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
src/main/java/com/somemore/auth/jwt/filter Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ private EncodedToken getAccessToken(HttpServletRequest request) {
6161 EncodedToken accessToken = findAccessTokenFromCookie (request );
6262
6363 if (accessToken .isUninitialized ()) {
64- accessToken = new EncodedToken (request . getHeader ( "Authorization" ) );
64+ accessToken = findAccessTokenFromHeader (request );
6565 }
6666
6767 if (accessToken .isUninitialized ()) {
@@ -72,6 +72,15 @@ private EncodedToken getAccessToken(HttpServletRequest request) {
7272 return accessToken .removePrefix (prefix );
7373 }
7474
75+ private static EncodedToken findAccessTokenFromHeader (HttpServletRequest request ) {
76+ String authorizationHeader = request .getHeader ("Authorization" );
77+ if (authorizationHeader == null || authorizationHeader .isEmpty ()) {
78+ return new EncodedToken ("UNINITIALIZED" );
79+ }
80+
81+ return new EncodedToken (authorizationHeader );
82+ }
83+
7584 private EncodedToken findAccessTokenFromCookie (HttpServletRequest request ) {
7685 Cookie [] cookies = request .getCookies ();
7786 if (cookies == null ) {
You can’t perform that action at this time.
0 commit comments