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

Expiration config not working #470

Closed
michele-grifa opened this issue Sep 5, 2023 · 4 comments
Closed

Expiration config not working #470

michele-grifa opened this issue Sep 5, 2023 · 4 comments

Comments

@michele-grifa
Copy link

Sanctum Version

3.3.0

Laravel Version

9.52.15

PHP Version

8.0."

Database Driver & Version

No response

Description

I'm trying to set the expiration at 240 minutes, but when I create the token, it is instantly invalid. In the database the expires_at column is null on all the tokens generated.

Steps To Reproduce

  • Set expiration to 240 in config/sanctum.php
  • Create a new token
  • Try to use the token in a request
  • Response is Unauthenticated, the token is not valida anymore
@driesvints
Copy link
Member

Could it be that this is due to #459 (comment) ?

If you apply the change from 95a0181 in the sanctum.php config file does it work for you?

@michele-grifa
Copy link
Author

No, the problem is present in a fresh install of Sanctum.

@github-actions
Copy link

github-actions bot commented Sep 7, 2023

Thank you for reporting this issue!

As Laravel is an open source project, we rely on the community to help us diagnose and fix issues as it is not possible to research and fix every issue reported to us via GitHub.

If possible, please make a pull request fixing the issue you have described, along with corresponding tests. All pull requests are promptly reviewed by the Laravel team.

Thank you!

@michele-grifa
Copy link
Author

I found the solution. I'm using SQL Server 2019 and with that I need to specify ->timestamps(2) in the migration file or the date are always wrong.

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

No branches or pull requests

2 participants