File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,8 @@ class JwtGuard extends AbstractAuthGuard
3333 */
3434 protected $ request ;
3535
36+ protected $ headerName = 'Authorization ' ;
37+
3638 /**
3739 * JwtGuardAbstract constructor.
3840 */
@@ -43,13 +45,14 @@ public function __construct(
4345 RequestInterface $ request
4446 ) {
4547 parent ::__construct ($ config , $ name , $ userProvider );
48+ $ this ->headerName = $ config ['header_name ' ] ?? 'Authorization ' ;
4649 $ this ->jwtManager = new JWTManager ($ config );
4750 $ this ->request = $ request ;
4851 }
4952
5053 public function parseToken ()
5154 {
52- $ header = $ this ->request ->header (' Authorization ' , '' );
55+ $ header = $ this ->request ->header ($ this -> headerName , '' );
5356 if (Str::startsWith ($ header , 'Bearer ' )) {
5457 return Str::substr ($ header , 7 );
5558 }
You can’t perform that action at this time.
0 commit comments