Skip to content

Token not being parsed if encrypted #6

Open

Description

@tomstreeter

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?

Activity

  1. tomstreeter commented on Jan 6, 2020

    @tomstreeter
    Author

    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.

  2. ollieread commented on Jan 7, 2020

    @ollieread
    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.

  3. self-assigned this
    on Jan 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions