gamonoid / icehrm

Manage your employees easily with a robust and efficient Human Resource Management System
http://icehrm.com
Other
567 stars 368 forks source link

Mobile App login issue #275

Open chopperpl opened 2 years ago

chopperpl commented 2 years ago

Hello, I've been evaluating this script and came to a halt with mobile app. When I scan the qr code I'm getting the error "the error occure when login" and the server logs the following: `PHP Fatal error: Uncaught UnexpectedValueException: Wrong number of segments in /ICE-PATH/core/lib/composer/vendor/firebase/php-jwt/src/JWT.php:83 [Mon Sep 27 11:39:15.600877 2021] [fcgid:warn] [pid 10601:tid 140586711488256] [client :61188] mod_fcgid: stderr: Stack trace: [Mon Sep 27 11:39:15.600885 2021] [fcgid:warn] [pid 10601:tid 140586711488256] [client :61188] mod_fcgid: stderr: #0 /ICE-PATH/core/src/Classes/JwtTokenService.php(27): Firebase\JWT\JWT::decode() [Mon Sep 27 11:39:15.600893 2021] [fcgid:warn] [pid 10601:tid 140586711488256] [client :61188] mod_fcgid: stderr: #1 /ICE-PATH/core/src/Classes/RestEndPoint.php(428): Classes\JwtTokenService->getBaseToken() [Mon Sep 27 11:39:15.600900 2021] [fcgid:warn] [pid 10601:tid 140586711488256] [client :61188] mod_fcgid: stderr: #2 /ICE-PATH/core/src/Classes/RestEndPoint.php(372): Classes\RestEndPoint->getBearerToken() [Mon Sep 27 11:39:15.600907 2021] [fcgid:warn] [pid 10601:tid 140586711488256] [client :61188] mod_fcgid: stderr: #3 /ICE-PATH/core/src/Classes/RestEndPoint.php(99): Classes\RestEndPoint->validateAccessToken() [Mon Sep 27 11:39:15.600914 2021] [fcgid:warn] [pid 10601:tid 140586711488256] [client :61188] mod_fcgid: stderr: #4 /ICE-PATH/core/src/Employees/Admin/Api/EmployeesAdminManager.php(36): Classes\RestEndPoint->process()

[Mon Sep 27 11:39:15.600928 2021] [fcgid:warn] [pid 10601:tid 140586711488256] [client :61188] mod_fcgid: stderr: #6 /home/adamjaniec/ in /ICE-PATH/core/lib/composer/vendor/firebase/php-jwt/src/JWT.php on line 83`

Please beware the script is hosted in root of sub-domain. Any clues? I have only 5 days left for this eval and I really like the functionality. I hope this is just some config glitch that can be fixed quickly... Thanks

chopperpl commented 2 years ago

I guess, I'm the only one with this issue... BTW, the generated token red from the QR code seems to be valid according to jwt.io testing tool and rest api is returning random number. I'm running this on Apache and htaccess file seems to redirect correctly.

pantherale0 commented 2 years ago

Hi @chopperpl

I also had this issue, doing some digging it looks like https://github.com/gamonoid/icehrm/commit/df554680c49eb707a46380dbdb97a59ac83e2095 has caused an issue when confirming the auth token.

I got a response on echo and that seems to work as it does not require a token. All of the other endpoints returned a 500 with the same error you had.

I've just opened a PR to get this fixed, hopefully maintainer merges for future release.

https://github.com/gamonoid/icehrm/pull/278