codeigniter4 / shield

Authentication and Authorization for CodeIgniter 4
https://shield.codeigniter.com
MIT License
359 stars 128 forks source link

Bug: Bearer prefix on auth header (JWT Authenticator) #1038

Closed MrFrost-Nv27 closed 7 months ago

MrFrost-Nv27 commented 7 months ago

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

kenjis commented 7 months ago

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

MrFrost-Nv27 commented 7 months ago

okay, this my pull request #1039

kenjis commented 7 months ago

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

MrFrost-Nv27 commented 7 months ago

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

Yes that good