File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 1919use CakeDC \Api \Service \Action \Action ;
2020use CakeDC \Users \Controller \Traits \LoginTrait ;
2121use CakeDC \Users \Exception \UserNotFoundException ;
22+ use Authentication \IdentityInterface ;
23+ use Cake \Datasource \EntityInterface ;
2224
2325/**
2426 * Class LoginAction
@@ -82,6 +84,14 @@ public function execute()
8284 {
8385 $ socialLogin = false ;
8486 $ user = $ this ->Auth ->getIdentity ();
87+
88+ if ($ user instanceof IdentityInterface) {
89+ $ user = $ user ->getOriginalData ()->toArray ();
90+ }
91+ if ($ user instanceof EntityInterface) {
92+ $ user = $ user ->toArray ();
93+ }
94+
8595 $ user = $ this ->_afterIdentifyUser ($ user , $ socialLogin );
8696 if (empty ($ user )) {
8797 throw new UserNotFoundException (__d ('CakeDC/Api ' , 'User not found ' ), 401 );
You can’t perform that action at this time.
0 commit comments