signifly / laravel-janitor Goto Github PK
View Code? Open in Web Editor NEW๐ Easily add login proxy to your Laravel API
License: MIT License
๐ Easily add login proxy to your Laravel API
License: MIT License
laravel-janitor/src/PassportProxy.php
Line 68 in 2769109
That call to ->revoke()
might return false
in which case it shouldn't send that event (and it should do something, but what I'm not sure).
laravel-janitor/src/PassportProxy.php
Line 114 in 2769109
This fetches the first client, however it is possible for there to be more than one client.
Is there any plan to support:
Hi,
First of all, thanks for this package.
Can you update the composer.json file in order to support Laravel 9?
Thanks in advance!
laravel-janitor/src/PassportProxy.php
Line 29 in 2769109
This seems to go searching the user provider itself (and it assumes it's some sort of Eloquent/DB-ish thing too). It should, though, assume that the provider implements the User Provider Contract (lluminate\Contracts\Auth\UserProvider):
...and just call it rather than do all the work itself.
None of the code seems to have PHP Doc.
As said, I am getting "InvalidClientCredentialsException" when trying to log in as an user that does exists:
/** @test */
public function should_login()
{
$user = factory(User::class)->create([
'email' => '[email protected]',
'password' => $password = bcrypt('secret')
]);
$this->assertDatabaseHas('users', [
'email' => '[email protected]',
'password' => $password
]); // this passes
$this
->withoutExceptionHandling()
->json('POST', 'api/login', [
'email' => $user->email,
'password' => 'secret'
])
->assertStatus(200);
}
What could be the issue?
I am using passport driver.
EDIT: OK, I Added the $this->artisan('passport:install');
line but now I get the other exception:
GuzzleHttp\Exception\ConnectException : cURL error 7: Failed to connect to 127.0.0.1 port 80: Connection refused
I made a custom proxy and there it works.
laravel-janitor/src/PassportProxy.php
Line 116 in 2769109
One can ask Passport for the client name or model.
/**
* Get a new client model instance.
*
* @return \Laravel\Passport\Client
*/
public static function client()
{
return new static::$clientModel;
}
You probably want the latter; it's technically less likely to fall over (although I don't see upstream renaming the oauth_*
tables any time soon).
Will you add support for laravel 6 and when? Tnx for awesome package!
Hi there,
thanks for your awesome package!
I was just trying to upgrade my project to Laravel 8. I get an error that the guzzle
-dependency doesn't work at the same time as the requirement for Laravel 8 (which is ^7.0.1
).
On the other hand I saw that you commited some changes focusing on Laravel 8 support already a month ago. Perhaps it's just a matter of setting up a release for composer?
Thanks in advance!
Chris
Great package! Thanks for this, it has helped me out.
A couple of issues/questions:
It would be great if we had the ability to override the Passport model used. In my app I have extended the Passport model to allow for the ID column to be UUID's. At the moment, my application fails as the Client ID that is returned from getClientCredentials() function is 2 when in actual fact it is 02f5b33a-5735-4fe6-87bf-2e062d745271.
Allow for the ability to define a client, as it stands it just grabs the first password client.
laravel-janitor/src/AbstractProxy.php
Line 43 in 2769109
It's hard coded as:
$userClass = config('auth.providers.users.model');
However that's an assumption.
I wonder if there should be some level of configuration here? That'd be a good default but it may not always hold true.
Hello,
Due to composer
requirements, its unable to install with PHP 8. Are there any plan for supporting PHP 8?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.