-
Notifications
You must be signed in to change notification settings - Fork 290
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 is not working in #464
Comments
Hey there, thanks for reporting this issue. We'll need more info and/or code to debug this further. Can you please create a repository with the command below, commit the code that reproduces the issue as one separate commit on the main/master branch and share the repository here? Please make sure that you have the latest version of the Laravel installer in order to run this command. Please also make sure you have both Git & the GitHub CLI tool properly set up.
Do not amend and create a separate commit with your custom changes. After you've posted the repository, we'll try to reproduce the issue. Thanks! |
Hi @crynobone , Thanks for your help. I setup the project using docker. And I also included everything ready. You only need to run |
@hpt123456 can you provide a link to a public repo? |
Sorry I thought link was included. Here is the link https://github.com/hpt123456/bug-report |
No, the expiration is only used in below: sanctum/src/SanctumServiceProvider.php Line 120 in 6bd2cc3
And validated against Line 159 in 6bd2cc3
You should be able to do it by using the following: $token = $request->user()->createToken(
name: 'personal-token',
expiresAt: now()->addMinutes(30)
)->plainTextToken; |
Sanctum Version
3.2
Laravel Version
10.10
PHP Version
8.2.8
Database Driver & Version
mariadb:10
Description
What I understand from documentation if I set
expiration' => 50000,
in cofig/sanctum.php file and I create below code in one of the controller method.$token = $request->user()->createToken('personal-token')->plainTextToken;
I should see expires_at with some datetime value at personal_access_tokens table, Am I right? But I got null. I could add that datetime value in expires_at column at personal_access_tokens* table by some ways. But, I would like to use from package if it already has that feature.
Steps To Reproduce
config/auth.php
config/sanctum.php
One of the controller method
The text was updated successfully, but these errors were encountered: