mirror of
https://github.com/elyby/accounts.git
synced 2025-01-23 12:03:31 +05:30
Fixes ACCOUNTS-54A. Include deleted applications in the lookup for exists applications.
This commit is contained in:
parent
9620ff75eb
commit
3646bfcb64
@ -90,7 +90,10 @@ class OauthClientForm {
|
||||
}
|
||||
|
||||
protected function isClientExists(string $id): bool {
|
||||
return OauthClient::find()->andWhere(['id' => $id])->exists();
|
||||
return OauthClient::find()
|
||||
->includeDeleted()
|
||||
->andWhere(['id' => $id])
|
||||
->exists();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -88,4 +88,23 @@ class CreateClientCest {
|
||||
$I->canSeeResponseJsonMatchesJsonPath('$.data.createdAt');
|
||||
}
|
||||
|
||||
public function testCreateApplicationWithTheSameNameAsDeletedApp(FunctionalTester $I) {
|
||||
$I->wantTo('create application with the same name as the recently deleted application');
|
||||
$I->amAuthenticated('admin');
|
||||
$this->route->createClient('application', [
|
||||
'name' => 'Deleted OAuth Client',
|
||||
'description' => '',
|
||||
'redirectUri' => 'http://some-site.com/oauth/ely',
|
||||
'websiteUrl' => 'http://some-site.com',
|
||||
]);
|
||||
$I->canSeeResponseCodeIs(200);
|
||||
$I->canSeeResponseIsJson();
|
||||
$I->canSeeResponseContainsJson([
|
||||
'success' => true,
|
||||
'data' => [
|
||||
'clientId' => 'deleted-oauth-client1',
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -116,7 +116,7 @@ return [
|
||||
'id' => 'deleted-oauth-client',
|
||||
'secret' => 'YISLDvIHlLbhsvYoIJScUzTURVXK32Q58sHWSFKyO71iCIlv4YM2Zt1kEK7DQLXX',
|
||||
'type' => 'application',
|
||||
'name' => 'I was deleted :(',
|
||||
'name' => 'Deleted OAuth Client',
|
||||
'description' => null,
|
||||
'redirect_uri' => 'http://not-exists-site.com/oauth/ely',
|
||||
'website_url' => '',
|
||||
|
Loading…
x
Reference in New Issue
Block a user