mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-06 21:18:11 -04:00
feat(api-tokens): roll a token to replace its secret
Keep the description, permissions, scopes, and expiry. Move the row actions into a dropdown menu and measure the dropdown panel after it is shown, so menus at the right edge stay on screen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
edee5ccfd6
commit
263eab5d27
+1
-7
@@ -23,7 +23,6 @@ use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Support\Facades\URL;
|
||||
use Illuminate\Support\Str;
|
||||
use Laravel\Fortify\Contracts\PasskeyUser;
|
||||
use Laravel\Fortify\PasskeyAuthenticatable;
|
||||
use Laravel\Fortify\TwoFactorAuthenticatable;
|
||||
@@ -269,12 +268,7 @@ class User extends Authenticatable implements PasskeyUser, SendsEmail
|
||||
|
||||
public function createToken(string $name, array $abilities = ['read'], ?DateTimeInterface $expiresAt = null, ?int $teamId = null)
|
||||
{
|
||||
$plainTextToken = sprintf(
|
||||
'%s%s%s',
|
||||
config('sanctum.token_prefix', ''),
|
||||
$tokenEntropy = Str::random(40),
|
||||
hash('crc32b', $tokenEntropy)
|
||||
);
|
||||
$plainTextToken = PersonalAccessToken::generateSecret();
|
||||
|
||||
$token = $this->tokens()->create([
|
||||
'name' => $name,
|
||||
|
||||
Reference in New Issue
Block a user