Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function loginAction() {
- $em = $this->getDoctrine()->getManager();
- $request = $this->getRequest();
- if ($request->getMethod() == 'POST') {
- $username = $request->request->get('username');
- $password = $request->request->get('password');
- $test = $em->getRepository('MedBundle:Med')->findOneBy(array('username' => $username));
- if (!($test)) { var_dump('error'); } else{
- $salt= $test->getSalt();
- $pass = crypt($password,$salt);
- if ( $pass === $test->getPassword() ) {
- var_dump('success'); }
- }
- $x = $this->get('lexik_jwt_authentication.jwt_manager')->create($test);
- var_dump($x);
- }
- return $this->render('default/login.html.twig');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement