Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't get acess token in LoginProxy #37

Open
aityahiaidir opened this issue Nov 29, 2017 · 5 comments
Open

can't get acess token in LoginProxy #37

aityahiaidir opened this issue Nov 29, 2017 · 5 comments

Comments

@aityahiaidir
Copy link

aityahiaidir commented Nov 29, 2017

Hello,

it's not Larapi issue I used some part of your configuration to mount my backend API for SPA React UI, I focused on authentication (login logout) part, everything works fine for authentication (I get the token and user can refresh to get new one).

but when i try de Logout i get FatalThrowableError when trying to get user access token in LoginProxy

Symfony\Component\Debug\Exception\FatalThrowableError: Call to a member function token() on null in file LoginProxy

I did not make any changes to LoginProxy, maybe I missed something from my project setup, can you give me a track of the possible cause of this issue.

@pishguy
Copy link

pishguy commented Dec 5, 2017

@aityahiaidir did you update cloned source code with pull requests?

https://github.com/esbenp/larapi/pulls

@aityahiaidir
Copy link
Author

@MahdiPishguy
no i didn't done, which code, my one code ?

@pishguy
Copy link

pishguy commented Dec 6, 2017

@aityahiaidir check pull requests and apply them on your local project, it seems this problem can be fine

@nteath
Copy link

nteath commented Apr 26, 2019

@aityahiaidir It seems I have the same issue. Did you solve this?
After successful access token generation the user is not logged in and the auth()->user() returns null.

@locto03
Copy link

locto03 commented Sep 24, 2019

@nteath I have the same problem too. The way I fixed it is using middleware auth:ap for the logout route. My code is Route::post('auth/logout', 'LoginController@logout')->middleware('auth:api');

Also from the client, you have send a post request that has Authorization Bearer token. This way the authmanager can use the included access token in your request to retrieve the correct user

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants