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

[2.x] Add sanctum:prune-expired command for removing expired tokens. #348

Merged
merged 3 commits into from Mar 25, 2022

Conversation

yuraplohov
Copy link
Contributor

This command has long been needed by developers.
A similar command is present in Telescope and Passport packages.

@taylorotwell taylorotwell merged commit 3d372e6 into laravel:2.x Mar 25, 2022
@ankurk91
Copy link
Contributor

The command does not return any thing.
The exit codes must be added

@yuraplohov yuraplohov deleted the prune-expired branch March 26, 2022 08:14
@driesvints
Copy link
Member

Thanks @ankurk91. I sent in a PR for that: #351

@EdgarSedov
Copy link

EdgarSedov commented Apr 12, 2022

@yuraplohov @ankurk91 @driesvints
Hey guys, thanks for awesome command, it's good that we don't need to write it ourselves.

I have one question - is there any special reason why we use created_at instead of last_used_at as where condition for pruning?

@yuraplohov
Copy link
Contributor Author

yuraplohov commented Apr 13, 2022

Thank you, @EdgarSedov

I used created_at in this logic, because expiration of token in Sanctum based on created_at exactly. Maybe, expiration by last_used_at is needed in this package, but that's another question. I saw PR #349 with similar idea recently.

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

Successfully merging this pull request may close these issues.

None yet

5 participants