WebauthnEnabledKeyController.php 546 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace App\Http\Controllers\Auth;
  3. use App\Http\Controllers\Controller;
  4. use Illuminate\Http\Request;
  5. class WebauthnEnabledKeyController extends Controller
  6. {
  7. public function store(Request $request)
  8. {
  9. $webauthnKey = user()->webauthnKeys()->findOrFail($request->id);
  10. $webauthnKey->enable();
  11. return response('', 201);
  12. }
  13. public function destroy($id)
  14. {
  15. $webauthnKey = user()->webauthnKeys()->findOrFail($id);
  16. $webauthnKey->disable();
  17. return response('', 204);
  18. }
  19. }