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

Token not being parsed if encrypted #6

Open
tomstreeter opened this issue Jan 5, 2020 · 2 comments
Open

Token not being parsed if encrypted #6

tomstreeter opened this issue Jan 5, 2020 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@tomstreeter
Copy link

tomstreeter commented Jan 5, 2020

This is quite possibly me doing something wrong, but I can successfully set a token for a user and retrieve the user information via

$user =Auth::guard('api')->user() (And there was much rejoicing.)

as long as our old friend

\App\Http\Middleware\EncryptCookies::class

is not active in the 'api' middleware group. (less rejoicing occurs)

Put another way, it appears that the api_login_ token is getting encrypted, but it's not getting decrypted. Is there something I'm missing?

@tomstreeter
Copy link
Author

tomstreeter commented Jan 6, 2020

Big surprise, it was me. For some reason (probably -- definitely -- me not understanding the implications of what I did) I had changed the 'defaults' guard in config/auth.php FROM web to api. Your documentation didn't suggest that. I can't tell you why I thought it was a good idea. No answer puts me in a good light, so I'll own it.

There is no bug. There's only a user proving once again that nothing is foolproof because fools are so ingenious.

This package is a lifesaver. Thank you.

@ollieread
Copy link
Member

@tomstreeter You're welcome.

However, changing the default guard like that shouldn't cause the issue you're seeing. I'll reopen this and see if I can recreate it because that definitely shouldn't be happening.

@ollieread ollieread reopened this Jan 7, 2020
@ollieread ollieread added the bug Something isn't working label Jan 12, 2020
@ollieread ollieread self-assigned this Jan 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants