1
0
Fork 0
forked from mirror/pixelfed

Merge pull request #3667 from pixelfed/staging

Staging
This commit is contained in:
daniel 2022-09-25 08:25:38 -06:00 committed by GitHub
commit 8a93e003d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -388,15 +388,15 @@ class ApiV1Dot1Controller extends Controller
abort_if(!$user, 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 [
'id' => $key + 1,
'did' => encrypt($token->id),
'name' => $token->name,
'name' => $token->client->name,
'scopes' => $token->scopes,
'revoked' => $token->revoked,
'created_at' => $token->created_at,
'expires_at' => $token->expires_at
'created_at' => str_replace('@', 'at', now()->parse($token->created_at)->format('M j, Y @ g:i:s A')),
'expires_at' => str_replace('@', 'at', now()->parse($token->expires_at)->format('M j, Y @ g:i:s A'))
];
});