mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-15 05:00:49 +08:00
[admin] remove two-step authentication
This commit is contained in:
@@ -287,4 +287,14 @@ class UserController extends Controller
|
||||
return $this->success(['success' => $result]);
|
||||
}
|
||||
|
||||
public function removeTwoStepAuthentication(Request $request): array
|
||||
{
|
||||
$user = Auth::user();
|
||||
$request->validate([
|
||||
'uid' => 'required',
|
||||
]);
|
||||
$result = $this->repository->removeTwoStepAuthentication($user, $request->uid, );
|
||||
return $this->success(['success' => $result]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -53,6 +53,11 @@ class UserResource extends JsonResource
|
||||
$out['completed_torrents_count'] = $this->completed_torrents_count;
|
||||
$out['incomplete_torrents_count'] = $this->incomplete_torrents_count;
|
||||
}
|
||||
|
||||
if (nexus()->isPlatformAdmin() && $request->routeIs('users.show')) {
|
||||
$out['two_step_secret'] = $this->two_step_secret;
|
||||
}
|
||||
|
||||
return $out;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user