Search code examples
phplaraveljwtlumenserver-error

Auth::logout() is working in local but not in server for JWT authentication in Lumen


In my Laravel Lumen (version 8) application, When I'm trying to log out using Auth::logout() 500 server error is occurring. I'm not able to capture the log why this issue is there.

My logout() is defined as below :

public function logout()
{
     Auth::logout();

     return response()->json(['message' => 'Successfully logged out']);
}  

I have found 500 error. The actual error is not showing.

I have tried to fix with every possible changes. But nothing worked for me. Kindly help me on this. Thanks in advance.

Note :- 1. I have tried with auth()->logout(). but didn't work. 2. I have also tried with session flush or destory, still didn't work. 3. Also tried with Auth::invalidate, didn't work.

In any of the above changes, 500 server error is there and even the token is not expiring.


Solution

  • My logs folder has not write permission That's why I'm not able to check the error. Now my issue has fixed.

    Thanks everyone for your valuable feedback.