Unverified Commit 418bbe25 authored by Viral Solani's avatar Viral Solani Committed by GitHub

Merge pull request #361 from viralsolani/analysis-qxnYBB

Apply fixes from StyleCI
parents 9a93fab0 03cd08fb
......@@ -20,7 +20,7 @@ class AuthController extends APIController
public function login(Request $request)
{
$validation = Validator::make($request->all(), [
'email' => 'required|email',
'email' => 'required|email',
'password' => 'required|min:4',
]);
......
......@@ -63,18 +63,18 @@ class Kernel extends HttpKernel
* @var array
*/
protected $routeMiddleware = [
'auth' => \Illuminate\Auth\Middleware\Authenticate::class,
'auth' => \Illuminate\Auth\Middleware\Authenticate::class,
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
'can' => \Illuminate\Auth\Middleware\Authorize::class,
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
'timeout' => \App\Http\Middleware\SessionTimeout::class,
'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
'can' => \Illuminate\Auth\Middleware\Authorize::class,
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
'timeout' => \App\Http\Middleware\SessionTimeout::class,
/*
* Access Middleware
*/
'access.routeNeedsRole' => \App\Http\Middleware\RouteNeedsRole::class,
'access.routeNeedsRole' => \App\Http\Middleware\RouteNeedsRole::class,
'access.routeNeedsPermission' => \App\Http\Middleware\RouteNeedsPermission::class,
// 'jwt.auth' => GetUserFromToken::class,
// 'jwt.refresh' => RefreshToken::class,
......
......@@ -98,17 +98,17 @@ class User extends Authenticatable implements JWTSubject
public function getJWTCustomClaims()
{
return [
'id' => $this->id,
'first_name' => $this->first_name,
'last_name' => $this->last_name,
'email' => $this->email,
'picture' => $this->getPicture(),
'confirmed' => $this->confirmed,
'role' => optional($this->roles()->first())->name,
'id' => $this->id,
'first_name' => $this->first_name,
'last_name' => $this->last_name,
'email' => $this->email,
'picture' => $this->getPicture(),
'confirmed' => $this->confirmed,
'role' => optional($this->roles()->first())->name,
'permissions' => $this->permissions()->get(),
'status' => $this->status,
'created_at' => $this->created_at->toIso8601String(),
'updated_at' => $this->updated_at->toIso8601String(),
'status' => $this->status,
'created_at' => $this->created_at->toIso8601String(),
'updated_at' => $this->updated_at->toIso8601String(),
];
}
}
......@@ -10,7 +10,7 @@ class LoginTest extends TestCase
public function users_can_login_through_api()
{
$res = $this->json('POST', '/api/v1/auth/login', [
'email' => $this->user->email,
'email' => $this->user->email,
'password' => '1234',
])
->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