Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
laravel-adminpanel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
laravel-adminpanel
Commits
03cd08fb
Commit
03cd08fb
authored
Mar 07, 2019
by
Viral Solani
Committed by
StyleCI Bot
Mar 07, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply fixes from StyleCI
parent
9a93fab0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
19 deletions
+19
-19
AuthController.php
app/Http/Controllers/Api/V1/AuthController.php
+1
-1
Kernel.php
app/Http/Kernel.php
+7
-7
User.php
app/Models/Access/User/User.php
+10
-10
LoginTest.php
tests/Feature/Api/V1/LoginTest.php
+1
-1
No files found.
app/Http/Controllers/Api/V1/AuthController.php
View file @
03cd08fb
...
@@ -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'
,
]);
]);
...
...
app/Http/Kernel.php
View file @
03cd08fb
...
@@ -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,
...
...
app/Models/Access/User/User.php
View file @
03cd08fb
...
@@ -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
(),
];
];
}
}
}
}
tests/Feature/Api/V1/LoginTest.php
View file @
03cd08fb
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment