Comments (4)
Won't Fix
Ok, I've read your issue again, and here is why I've taken the decision to wont-fix
the reported problem:
1. The retrieval of a given user is not the scope of this library.
Retrieving users based on their unique
identifiers is a scope of Illuminate\Contracts\Auth\UserProvider
If you are using the default UserProvider, that one is Illuminate\Auth\EloquentUserProvider
and here is a snippet of the exact method that does that:
/**
* Retrieve a user by their unique identifier.
*/
public function retrieveById($identifier)
{
$model = $this->createModel();
return $model->newQuery()
->where($model->getAuthIdentifierName(), $identifier)
->first();
}
As you can notice here, it's a single where
condition performed against the User
model.
As you can also notice, the database table field
is determined by the getAuthIdentifierName()
method, which is provided in any model implementing the Illuminate\Contracts\Auth\Authenticatable
interface.
So, you have some options here:
1.1. Replace the ID identifier.
Instead of using the id
field, you may use the email field, by overriding the getAuthIdentifier()
directly on your User model.
1.2. Extend the User Provider.
Following the Laravel documentation, you may be able to register your own resolver. The documentation can be found at this link: authentication#adding-custom-user-providers
2. Application specific design decision.
The decision to distribute the user's information was application based. In most cases I've seen, the user's database is centralized alongside the tenants' table.
It's not fair that I include possible breaking changes into a too specific use case.
By this reason, I'm ruling out this as a security breach on the library, since the use-case is not recommended or common.
Thank you, you may contact me at Telegram if you need help implementing the custom logic. It will be a pleasure to help you out.
For now, I'm closing this issue.
from laravel-jwt.
ping @hernandev
from laravel-jwt.
Makes sense to me, let me check on this right now, and get back here.
from laravel-jwt.
I understand. Will try the options you suggested. Thanks!
from laravel-jwt.
Related Issues (20)
- Error: KeyGenerateCommand::handle() does not exist HOT 6
- \Illuminate\Auth\Events\Login not firing HOT 8
- Contributing guide HOT 7
- Package autodiscovery HOT 2
- Allow to change secret key before or after Manager initialization HOT 1
- Genarate token for never expirate HOT 3
- Como funciona a função tokenFromUser ?
- Method Codecasts\Auth\JWT\Console\KeyGenerateCommand::handle() does not exist HOT 2
- Redirect to [login] when JWT isn't sent? HOT 6
- Don't forget config:clear!
- Method issue() does not exist. HOT 1
- Decode token HOT 2
- Typo in readme.md? HOT 1
- Adding RS-256/512 JWT signature methods HOT 1
- How to logout/blacklist HOT 5
- manual .env key HOT 1
- Repository abandoned? HOT 2
- Bearer Token and query parameter conflict HOT 1
- Laravel 8 compatibility
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 laravel-jwt.