File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5757 ],
5858 ],
5959 ],
60+ 'user-token ' => [
61+ 'type ' => Literal::class,
62+ 'options ' => [
63+ 'route ' => '/user-token ' ,
64+ 'defaults ' => [
65+ 'controller ' => Controller \UserController::class,
66+ 'action ' => 'user-token ' ,
67+ ],
68+ ],
69+ ]
6070 ],
6171 ],
6272 'controllers ' => [
Original file line number Diff line number Diff line change 77use Zend \Hydrator \ClassMethods ;
88use Zend \Mvc \Controller \AbstractActionController ;
99use Zend \ServiceManager \ServiceLocatorInterface ;
10+ use Zend \View \Model \JsonModel ;
1011use Zend \View \Model \ViewModel ;
1112use ProspectOne \UserModule \Entity \User ;
1213use ProspectOne \UserModule \Form \UserForm ;
@@ -394,6 +395,15 @@ public function getUserRole($user)
394395
395396 return $ rolecurrent ['role_id ' ];
396397 }
398+
399+ /**
400+ * @return JsonModel
401+ */
402+ public function userTokenAction ()
403+ {
404+ $ result = $ this ->userManager ->generateToken ();
405+ return new JsonModel ($ result );
406+ }
397407}
398408
399409
Original file line number Diff line number Diff line change 1717 */
1818class UserFormFactory implements FactoryInterface
1919{
20- /**
21- * @var ContainerInterface
22- */
23- private $ container ;
24-
25- /**
26- * UserFormFactory constructor.
27- * @param ContainerInterface|null $container
28- */
29- public function __construct (?ContainerInterface $ container = null )
30- {
31- if (!empty ($ container )) {
32- $ this ->container = $ container ;
33- }
34- }
35-
3620 /**
3721 * Create an object
3822 *
You can’t perform that action at this time.
0 commit comments