Comments (3)
Sanctum will check each guard in your config('sanctum.guard')
value in turn, until one provides a valid user. It will do this as soon as the guard is invoked.
If none return a valid user, then personal_access_tokens
are queried by the data provided in the Bearer request header. That ID query in your example comes from here:
/**
* Find the token instance matching the given token.
*
* @param string $token
* @return static|null
*/
public static function findToken($token)
{
if (strpos($token, '|') === false) {
return static::where('token', hash('sha256', $token))->first();
}
[$id, $token] = explode('|', $token, 2);
if ($instance = static::find($id)) {
return hash_equals($instance->token, hash('sha256', $token)) ? $instance : null;
}
}
I don't believe the code above should ever call a query like
select * from `users` where `users`.`id` = ? and `users`.`deleted_at` is null limit 1
so my hunch is that you have customised the PeronsalAccessToken
model and have other queries happening?
I think you would need to put this into a reproduction repo.
from framework.
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.
laravel new bug-report --github="--public"
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!
from framework.
Closing this issue because it's inactive, already solved, old or not relevant anymore. Feel to open up a new issue if you're still experiencing this.
from framework.
Related Issues (20)
- Your requirements could not be resolved to an installable set of packages. HOT 3
- During the Composer update process in the Laravel framework HOT 4
- DB schema breaking when using older MariaDB with Laravel 11.x HOT 2
- Pivot models $table variable not respected / overridden HOT 8
- Date comparison problem HOT 2
- Carbon type casting in Route parameter returns a fresh instance of Carbon HOT 1
- $connection property and Schema::connection are not working on migration HOT 2
- user appears to be logged out when password is updated (fortify) HOT 1
- Str::apa will lowercase accented words HOT 1
- Schema::getColumnType expects given column name to be lowercase HOT 3
- Backward compatibility makes `lang:publish` command useless! HOT 2
- PROPOSAL: Handling default values within \Illuminate\Queue\SerializesModels HOT 1
- Jobs in default queue not working HOT 1
- decrypt error occurs when php artisan env:decrypt is executed and the key without base64 prefix is used HOT 1
- Rules with numeric keys do not validate properly HOT 10
- 'datetime' casted attribute returning current date from am empty string in the db HOT 4
- Phpoption should be a dependency in Support HOT 1
- about FormRequest bail HOT 1
- Unescaped Reserverd keyword on Postgres HOT 2
- Custom route binding for backed enums doesn't work
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from framework.