Commit 03cd08fb authored by Viral Solani's avatar Viral Solani Committed by StyleCI Bot

Apply fixes from StyleCI

parent 9a93fab0
...@@ -20,7 +20,7 @@ class AuthController extends APIController ...@@ -20,7 +20,7 @@ class AuthController extends APIController
public function login(Request $request) public function login(Request $request)
{ {
$validation = Validator::make($request->all(), [ $validation = Validator::make($request->all(), [
'email' => 'required|email', 'email' => 'required|email',
'password' => 'required|min:4', 'password' => 'required|min:4',
]); ]);
......
...@@ -63,18 +63,18 @@ class Kernel extends HttpKernel ...@@ -63,18 +63,18 @@ class Kernel extends HttpKernel
* @var array * @var array
*/ */
protected $routeMiddleware = [ protected $routeMiddleware = [
'auth' => \Illuminate\Auth\Middleware\Authenticate::class, 'auth' => \Illuminate\Auth\Middleware\Authenticate::class,
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class, 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
'can' => \Illuminate\Auth\Middleware\Authorize::class, 'can' => \Illuminate\Auth\Middleware\Authorize::class,
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
'timeout' => \App\Http\Middleware\SessionTimeout::class, 'timeout' => \App\Http\Middleware\SessionTimeout::class,
/* /*
* Access Middleware * Access Middleware
*/ */
'access.routeNeedsRole' => \App\Http\Middleware\RouteNeedsRole::class, 'access.routeNeedsRole' => \App\Http\Middleware\RouteNeedsRole::class,
'access.routeNeedsPermission' => \App\Http\Middleware\RouteNeedsPermission::class, 'access.routeNeedsPermission' => \App\Http\Middleware\RouteNeedsPermission::class,
// 'jwt.auth' => GetUserFromToken::class, // 'jwt.auth' => GetUserFromToken::class,
// 'jwt.refresh' => RefreshToken::class, // 'jwt.refresh' => RefreshToken::class,
......
...@@ -98,17 +98,17 @@ class User extends Authenticatable implements JWTSubject ...@@ -98,17 +98,17 @@ class User extends Authenticatable implements JWTSubject
public function getJWTCustomClaims() public function getJWTCustomClaims()
{ {
return [ return [
'id' => $this->id, 'id' => $this->id,
'first_name' => $this->first_name, 'first_name' => $this->first_name,
'last_name' => $this->last_name, 'last_name' => $this->last_name,
'email' => $this->email, 'email' => $this->email,
'picture' => $this->getPicture(), 'picture' => $this->getPicture(),
'confirmed' => $this->confirmed, 'confirmed' => $this->confirmed,
'role' => optional($this->roles()->first())->name, 'role' => optional($this->roles()->first())->name,
'permissions' => $this->permissions()->get(), 'permissions' => $this->permissions()->get(),
'status' => $this->status, 'status' => $this->status,
'created_at' => $this->created_at->toIso8601String(), 'created_at' => $this->created_at->toIso8601String(),
'updated_at' => $this->updated_at->toIso8601String(), 'updated_at' => $this->updated_at->toIso8601String(),
]; ];
} }
} }
...@@ -10,7 +10,7 @@ class LoginTest extends TestCase ...@@ -10,7 +10,7 @@ class LoginTest extends TestCase
public function users_can_login_through_api() public function users_can_login_through_api()
{ {
$res = $this->json('POST', '/api/v1/auth/login', [ $res = $this->json('POST', '/api/v1/auth/login', [
'email' => $this->user->email, 'email' => $this->user->email,
'password' => '1234', 'password' => '1234',
]) ])
->assertStatus(200) ->assertStatus(200)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment