Skip to content

Commit

Permalink
security: cross-site request forgery
Browse files Browse the repository at this point in the history
  • Loading branch information
HDVinnie committed Sep 23, 2021
1 parent d4c6105 commit 5dc5263
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions resources/views/user/buttons/profile.blade.php
Expand Up @@ -32,9 +32,12 @@
</form>
@endif
@if((auth()->user()->block_notifications == 0 || auth()->user()->block_notifications == 0))
<a href="{{ route('notification_disable', ['username' => $user->username]) }}" class="btn btn-sm btn-danger">
<i class='{{ config('other.font-awesome') }} fa-bell-slash'></i> @lang('user.disable-notifications')
</a>
<form role="form" method="POST" action="{{ route('notification_disable', ['username' => $user->username]) }}" style="display: inline-block;">
@csrf
<button type="submit" class="btn btn-sm btn-danger">
<i class='{{ config('other.font-awesome') }} fa-bell-slash'></i> @lang('user.disable-notifications')
</button>
</form>
@else
<form role="form" method="POST" action="{{ route('notification_enable', ['username' => $user->username]) }}" style="display: inline-block;">
@csrf
Expand Down
2 changes: 1 addition & 1 deletion routes/web.php
Expand Up @@ -323,7 +323,7 @@
Route::post('/{username}/settings/change_pid', [App\Http\Controllers\UserController::class, 'changePID'])->name('change_pid');
Route::post('/{username}/settings/change_rid', [App\Http\Controllers\UserController::class, 'changeRID'])->name('change_rid');
Route::post('/{username}/settings/change_api_token', [App\Http\Controllers\UserController::class, 'changeApiToken'])->name('change_api_token');
Route::get('/{username}/settings/notification/disable', [App\Http\Controllers\UserController::class, 'disableNotifications'])->name('notification_disable');
Route::post('/{username}/settings/notification/disable', [App\Http\Controllers\UserController::class, 'disableNotifications'])->name('notification_disable');
Route::post('/{username}/settings/notification/enable', [App\Http\Controllers\UserController::class, 'enableNotifications'])->name('notification_enable');
Route::post('/{username}/settings/notification/account', [App\Http\Controllers\UserController::class, 'changeAccountNotification'])->name('notification_account');
Route::post('/{username}/settings/notification/following', [App\Http\Controllers\UserController::class, 'changeFollowingNotification'])->name('notification_following');
Expand Down

0 comments on commit 5dc5263

Please sign in to comment.