mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-04 09:04:03 +00:00
rename command to PurgeImpersonationTokens
This commit is contained in:
parent
c3c5955c84
commit
a0727fe7a7
3 changed files with 6 additions and 6 deletions
|
|
@ -10,13 +10,13 @@ use Stancl\Tenancy\Features\UserImpersonation;
|
||||||
/**
|
/**
|
||||||
* Clears expired impersonation tokens.
|
* Clears expired impersonation tokens.
|
||||||
*
|
*
|
||||||
* Tokens older than UserImpersonation::$ttl (60 seconds by default) are considered expired.
|
* Tokens older than UserImpersonation::$ttl are considered expired.
|
||||||
*
|
*
|
||||||
* @see Stancl\Tenancy\Features\UserImpersonation
|
* @see Stancl\Tenancy\Features\UserImpersonation
|
||||||
*/
|
*/
|
||||||
class ClearExpiredImpersonationTokens extends Command
|
class PurgeImpersonationTokens extends Command
|
||||||
{
|
{
|
||||||
protected $signature = 'tenants:clear-expired-impersonation-tokens';
|
protected $signature = 'tenants:purge-impersonation-tokens';
|
||||||
|
|
||||||
protected $description = 'Clear expired impersonation tokens.';
|
protected $description = 'Clear expired impersonation tokens.';
|
||||||
|
|
||||||
|
|
@ -119,8 +119,8 @@ class TenancyServiceProvider extends ServiceProvider
|
||||||
Commands\MigrateFresh::class,
|
Commands\MigrateFresh::class,
|
||||||
Commands\ClearPendingTenants::class,
|
Commands\ClearPendingTenants::class,
|
||||||
Commands\CreatePendingTenants::class,
|
Commands\CreatePendingTenants::class,
|
||||||
|
Commands\PurgeImpersonationTokens::class,
|
||||||
Commands\CreateUserWithRLSPolicies::class,
|
Commands\CreateUserWithRLSPolicies::class,
|
||||||
Commands\ClearExpiredImpersonationTokens::class,
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if (static::$migrateFreshOverride) {
|
if (static::$migrateFreshOverride) {
|
||||||
|
|
|
||||||
|
|
@ -382,7 +382,7 @@ test('expired impersonation tokens can be cleaned up using a command', function
|
||||||
expect(ImpersonationToken::find($oldToken->token))->not()->toBeNull();
|
expect(ImpersonationToken::find($oldToken->token))->not()->toBeNull();
|
||||||
expect(ImpersonationToken::find($anotherOldToken->token))->not()->toBeNull();
|
expect(ImpersonationToken::find($anotherOldToken->token))->not()->toBeNull();
|
||||||
|
|
||||||
pest()->artisan('tenants:clear-expired-impersonation-tokens')
|
pest()->artisan('tenants:purge-impersonation-tokens')
|
||||||
->assertExitCode(0)
|
->assertExitCode(0)
|
||||||
->expectsOutputToContain('2 expired impersonation tokens deleted');
|
->expectsOutputToContain('2 expired impersonation tokens deleted');
|
||||||
|
|
||||||
|
|
@ -399,7 +399,7 @@ test('expired impersonation tokens can be cleaned up using a command', function
|
||||||
|
|
||||||
// With ttl set to 80s, the active token should not be deleted (token is only considered expired if older than 80s)
|
// With ttl set to 80s, the active token should not be deleted (token is only considered expired if older than 80s)
|
||||||
UserImpersonation::$ttl = 80;
|
UserImpersonation::$ttl = 80;
|
||||||
pest()->artisan('tenants:clear-expired-impersonation-tokens')
|
pest()->artisan('tenants:purge-impersonation-tokens')
|
||||||
->assertExitCode(0)
|
->assertExitCode(0)
|
||||||
->expectsOutputToContain('0 expired impersonation tokens deleted');
|
->expectsOutputToContain('0 expired impersonation tokens deleted');
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue