Skip to content

Commit

Permalink
Fix maxlength for token names (laravel#1300)
Browse files Browse the repository at this point in the history
  • Loading branch information
driesvints authored Jun 19, 2020
1 parent 63c8b66 commit f984a7f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/Http/Controllers/ClientController.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function forUser(Request $request)
public function store(Request $request)
{
$this->validation->make($request->all(), [
'name' => 'required|max:255',
'name' => 'required|max:191',
'redirect' => ['required', $this->redirectRule],
'confidential' => 'boolean',
])->validate();
Expand Down Expand Up @@ -111,7 +111,7 @@ public function update(Request $request, $clientId)
}

$this->validation->make($request->all(), [
'name' => 'required|max:255',
'name' => 'required|max:191',
'redirect' => ['required', $this->redirectRule],
])->validate();

Expand Down
2 changes: 1 addition & 1 deletion src/Http/Controllers/PersonalAccessTokenController.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function forUser(Request $request)
public function store(Request $request)
{
$this->validation->make($request->all(), [
'name' => 'required|max:255',
'name' => 'required|max:191',
'scopes' => 'array|in:'.implode(',', Passport::scopeIds()),
])->validate();

Expand Down
6 changes: 3 additions & 3 deletions tests/Unit/ClientControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function test_clients_can_be_stored()
'name' => 'client name',
'redirect' => 'http://localhost',
], [
'name' => 'required|max:255',
'name' => 'required|max:191',
'redirect' => ['required', $redirectRule],
'confidential' => 'boolean',
])->andReturn($validator);
Expand Down Expand Up @@ -97,7 +97,7 @@ public function test_public_clients_can_be_stored()
'redirect' => 'http://localhost',
'confidential' => false,
], [
'name' => 'required|max:255',
'name' => 'required|max:191',
'redirect' => ['required', $redirectRule],
'confidential' => 'boolean',
])->andReturn($validator);
Expand Down Expand Up @@ -136,7 +136,7 @@ public function test_clients_can_be_updated()
'name' => 'client name',
'redirect' => 'http://localhost',
], [
'name' => 'required|max:255',
'name' => 'required|max:191',
'redirect' => ['required', $redirectRule],
])->andReturn($validator);
$validator->shouldReceive('validate')->once();
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/PersonalAccessTokenControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function test_tokens_can_be_updated()
'name' => 'token name',
'scopes' => ['user', 'user-admin'],
], [
'name' => 'required|max:255',
'name' => 'required|max:191',
'scopes' => 'array|in:'.implode(',', Passport::scopeIds()),
])->andReturn($validator);
$validator->shouldReceive('validate')->once();
Expand Down

0 comments on commit f984a7f

Please sign in to comment.