mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 14:31:26 +00:00
Update v1.1 api
This commit is contained in:
parent
78d82c7c2c
commit
613e98ce09
1 changed files with 3 additions and 1 deletions
|
@ -260,18 +260,20 @@ class ApiV1Dot1Controller extends Controller
|
|||
abort_if(!$user, 403);
|
||||
abort_if($user->status != null, 403);
|
||||
$agent = new Agent();
|
||||
$currentIp = $request->ip();
|
||||
|
||||
$activity = AccountLog::whereUserId($user->id)
|
||||
->whereAction('auth.login')
|
||||
->orderBy('created_at', 'desc')
|
||||
->limit(10)
|
||||
->get()
|
||||
->map(function($item) use($agent) {
|
||||
->map(function($item) use($agent, $currentIp) {
|
||||
$agent->setUserAgent($item->user_agent);
|
||||
return [
|
||||
'id' => $item->id,
|
||||
'action' => $item->action,
|
||||
'ip' => $item->ip_address,
|
||||
'ip_current' => $item->ip_address === $currentIp,
|
||||
'is_mobile' => $agent->isMobile(),
|
||||
'device' => $agent->device(),
|
||||
'browser' => $agent->browser(),
|
||||
|
|
Loading…
Reference in a new issue