public function interact() { // Fetch the entity, using provided identifiers... $entity = $this->getEntity(); // ... verify that the password matches // @todo: handle the other bits of A1, like rehashing and brute force checks $this->authenticator->checkPassword($this->getRequiredIdentifier('password'), $entity->password); // ... and return the formatted result. return $this->formatter->__invoke($entity); }
public function interact() { // Fetch the entity, using provided identifiers... $entity = $this->getEntity(); // Rate limit login attempts $this->rateLimiter->limit($entity); // ... verify that the password matches $this->authenticator->checkPassword($this->getRequiredIdentifier('password'), $entity->password); // ... and return the formatted result. return $this->formatter->__invoke($entity); }
/** * @param Form $form */ public function userCredentialsSubmitted($form) { $values = $form->getValues(); $user = $this->userRepo->findById($this->user->id)->fetch(); if (Authenticator::checkPassword($user->password, $values->oldpass)) { $this->userRepo->setPassword($this->user->id, $values->newpass); $this->flashMessage('Heslo nastaveno', 'success'); } else { $this->flashMessage('Staré heslo bylo zadáno nesprávně', 'error'); } $this->redirect('this'); }