2019-05-20 07:37:41 +02:00
|
|
|
<?php
|
|
|
|
|
2022-03-24 14:58:30 +01:00
|
|
|
use Illuminate\Support\Facades\Route;
|
2019-05-20 07:37:41 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| API Routes
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
2022-03-24 14:58:30 +01:00
|
|
|
/**
|
|
|
|
* Unprotected routes
|
|
|
|
*/
|
2022-03-19 00:14:20 +01:00
|
|
|
Route::get('user/name', 'UserController@show')->name('user.show.name');
|
2020-01-14 17:06:59 +01:00
|
|
|
|
2019-05-20 07:37:41 +02:00
|
|
|
|
2022-03-24 14:58:30 +01:00
|
|
|
/**
|
|
|
|
* Routes protected by the api authentication guard
|
|
|
|
*/
|
|
|
|
Route::group(['middleware' => 'auth:api-guard'], function () {
|
|
|
|
Route::get('user', 'UserController@show')->name('user.show'); // Returns email address in addition to the username
|
2021-10-16 11:26:18 +02:00
|
|
|
|
|
|
|
Route::get('settings/{settingName}', 'SettingController@show')->name('settings.show');
|
|
|
|
Route::get('settings', 'SettingController@index')->name('settings.index');
|
|
|
|
Route::post('settings', 'SettingController@store')->name('settings.store');
|
|
|
|
Route::put('settings/{settingName}', 'SettingController@update')->name('settings.update');
|
|
|
|
Route::delete('settings/{settingName}', 'SettingController@destroy')->name('settings.destroy');
|
|
|
|
|
|
|
|
Route::delete('twofaccounts', 'TwoFAccountController@batchDestroy')->name('twofaccounts.batchDestroy');
|
2022-05-25 13:41:46 +02:00
|
|
|
Route::post('twofaccounts/import', 'TwoFAccountController@import')->name('twofaccounts.import');
|
2021-10-16 11:26:18 +02:00
|
|
|
Route::patch('twofaccounts/withdraw', 'TwoFAccountController@withdraw')->name('twofaccounts.withdraw');
|
|
|
|
Route::post('twofaccounts/reorder', 'TwoFAccountController@reorder')->name('twofaccounts.reorder');
|
|
|
|
Route::post('twofaccounts/preview', 'TwoFAccountController@preview')->name('twofaccounts.preview');
|
|
|
|
Route::get('twofaccounts/{twofaccount}/qrcode', 'QrCodeController@show')->name('twofaccounts.show.qrcode');
|
|
|
|
Route::get('twofaccounts/count', 'TwoFAccountController@count')->name('twofaccounts.count');
|
|
|
|
Route::get('twofaccounts/{id}/otp', 'TwoFAccountController@otp')->where('id', '[0-9]+')->name('twofaccounts.show.otp');
|
|
|
|
Route::post('twofaccounts/otp', 'TwoFAccountController@otp')->name('twofaccounts.otp');
|
2019-05-24 14:44:41 +02:00
|
|
|
Route::apiResource('twofaccounts', 'TwoFAccountController');
|
2021-10-01 13:40:37 +02:00
|
|
|
|
2021-10-16 11:26:18 +02:00
|
|
|
Route::get('groups/{group}/twofaccounts', 'GroupController@accounts')->name('groups.show.twofaccounts');
|
|
|
|
Route::post('groups/{group}/assign', 'GroupController@assignAccounts')->name('groups.assign.twofaccounts');
|
2020-10-22 17:15:05 +02:00
|
|
|
Route::apiResource('groups', 'GroupController');
|
2021-09-18 00:00:50 +02:00
|
|
|
|
2021-10-16 11:26:18 +02:00
|
|
|
Route::post('qrcode/decode', 'QrCodeController@decode')->name('qrcode.decode');
|
2021-10-01 13:40:37 +02:00
|
|
|
|
2021-10-16 11:26:18 +02:00
|
|
|
Route::post('icons', 'IconController@upload')->name('icons.upload');
|
|
|
|
Route::delete('icons/{icon}', 'IconController@delete')->name('icons.delete');
|
2019-05-20 07:37:41 +02:00
|
|
|
});
|