codeigniter4 / shield

Authentication and Authorization for CodeIgniter 4

Home Page:https://shield.codeigniter.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug: Bearer prefix on auth header (JWT Authenticator)

MrFrost-Nv27 opened this issue · comments

PHP Version

8.2.1

CodeIgniter4 Version

4.2.5

Shield Version

1.0.1

Which operating systems have you tested for this bug?

Windows

Which server did you use?

apache

Database

MySQL

Did you customize Shield?

Yes, on JWT Authenticator is not same as JWT Filter on grab the token, JWT Filter was done with bearer prefix but in JWT Authenticator wasn't, please see my change below
Screenshot 2024-02-22 110240

What happened?

error malformed loggedIn method on JWT Authenticator because the method for grab the token isn't fixed with bearer prefix
Screenshot 2024-02-22 110456

Steps to Reproduce

add getTokenFromHeader method like JWT Filter in JWT Authenticator

Expected Output

easyly doing prefix or not on loggedin method with JWT Authenticator

Anything else?

nothing, just see my opinion and do update if it good

Thank you for reporting.
I can't see the changes in the screenshot, can you send a Pull Request?

okay, this my pull request #1039

Thank you for the PR!
I refactored it a bit. See #1040
If it is okay, please approve it.

Thank you for the PR! I refactored it a bit. See #1040 If it is okay, please approve it.

Yes that good