Skip to content

Commit

Permalink
fix: Unique check on access_tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
dogukanoksuz committed Nov 1, 2023
1 parent 56d2e07 commit 54f04b1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/Http/Controllers/API/Settings/AccessTokenController.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ public function index()
*/
public function create(Request $request)
{
validate([
'name' => 'required|unique:access_tokens,name',
]);

$token = Str::uuid();
AccessToken::create([
'user_id' => auth('api')->user()->id,
Expand Down

0 comments on commit 54f04b1

Please sign in to comment.