Add route to get TwoFAccount with sensitive data

This commit is contained in:
Bubka 2020-11-16 14:10:54 +01:00
parent 8253d28102
commit 27dd64a965
2 changed files with 13 additions and 0 deletions

View File

@ -93,6 +93,18 @@ public function show(TwoFAccount $twofaccount)
}
/**
* Display the specified resource with all attributes.
*
* @param \App\TwoFAccount $twofaccount
* @return \Illuminate\Http\Response
*/
public function showWithSensitive(TwoFAccount $twofaccount)
{
return response()->json($twofaccount->makeVisible(['uri', 'secret', 'algorithm']), 200);
}
/**
* Save new order.
*

View File

@ -38,6 +38,7 @@
Route::delete('twofaccounts/batch', 'TwoFAccountController@batchDestroy');
Route::patch('twofaccounts/reorder', 'TwoFAccountController@reorder');
Route::get('twofaccounts/{twofaccount}/withSensitive', 'TwoFAccountController@showWithSensitive');
Route::apiResource('twofaccounts', 'TwoFAccountController');
Route::patch('group/accounts', 'GroupController@associateAccounts');
Route::apiResource('groups', 'GroupController');