mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-20 05:21:27 +00:00
commit
8a93e003d7
1 changed files with 4 additions and 4 deletions
|
@ -388,15 +388,15 @@ class ApiV1Dot1Controller extends Controller
|
||||||
abort_if(!$user, 403);
|
abort_if(!$user, 403);
|
||||||
abort_if($user->status != null, 403);
|
abort_if($user->status != null, 403);
|
||||||
|
|
||||||
$res = $user->tokens->map(function($token, $key) {
|
$res = $user->tokens->sortByDesc('created_at')->take(10)->map(function($token, $key) {
|
||||||
return [
|
return [
|
||||||
'id' => $key + 1,
|
'id' => $key + 1,
|
||||||
'did' => encrypt($token->id),
|
'did' => encrypt($token->id),
|
||||||
'name' => $token->name,
|
'name' => $token->client->name,
|
||||||
'scopes' => $token->scopes,
|
'scopes' => $token->scopes,
|
||||||
'revoked' => $token->revoked,
|
'revoked' => $token->revoked,
|
||||||
'created_at' => $token->created_at,
|
'created_at' => str_replace('@', 'at', now()->parse($token->created_at)->format('M j, Y @ g:i:s A')),
|
||||||
'expires_at' => $token->expires_at
|
'expires_at' => str_replace('@', 'at', now()->parse($token->expires_at)->format('M j, Y @ g:i:s A'))
|
||||||
];
|
];
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue