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
418bbe25
Unverified
Commit
418bbe25
authored
Mar 07, 2019
by
Viral Solani
Committed by
GitHub
Mar 07, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #361 from viralsolani/analysis-qxnYBB
Apply fixes from StyleCI
parents
9a93fab0
03cd08fb
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 @
418bbe25
...
...
@@ -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'
,
]);
...
...
app/Http/Kernel.php
View file @
418bbe25
...
...
@@ -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,
...
...
app/Models/Access/User/User.php
View file @
418bbe25
...
...
@@ -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
(),
];
}
}
tests/Feature/Api/V1/LoginTest.php
View file @
418bbe25
...
...
@@ -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
)
...
...
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