1000 search results

40 lines | src/Repository/UserRepository.php
// ... lines 1 - 8
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
// ... lines 10 - 18
class UserRepository extends ServiceEntityRepository implements PasswordUpgraderInterface
{
// ... lines 21 - 28
public function upgradePassword(PasswordAuthenticatedUserInterface $user, string $newHashedPassword): void
{
// ... lines 31 - 37
}
}
See Code Block in Script
213 lines | src/Entity/User.php
// ... lines 1 - 8
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
// ... lines 10 - 14
class User implements UserInterface, PasswordAuthenticatedUserInterface
{
// ... lines 17 - 211
}
See Code Block in Script
// ... lines 1 - 5
use Symfony\Component\Security\Http\Event\CheckPassportEvent;
class CheckVerifiedUserSubscriber implements EventSubscriberInterface
{
// ... lines 10 - 14
public static function getSubscribedEvents()
{
return [
CheckPassportEvent::class => 'onCheckPassport',
];
}
}
See Code Block in Script
// ... lines 1 - 5
use Symfony\Component\Security\Http\Event\CheckPassportEvent;
class CheckVerifiedUserSubscriber implements EventSubscriberInterface
{
public function onCheckPassport(CheckPassportEvent $event)
{
dd($event);
}
// ... lines 14 - 20
}
See Code Block in Script
// ... lines 1 - 6
use Symfony\Component\Security\Http\Authenticator\Passport\UserPassportInterface;
// ... lines 8 - 9
class CheckVerifiedUserSubscriber implements EventSubscriberInterface
{
public function onCheckPassport(CheckPassportEvent $event)
{
$passport = $event->getPassport();
if (!$passport instanceof UserPassportInterface) {
throw new \Exception('Unexpected passport type');
}
}
// ... lines 19 - 25
}
See Code Block in Script
// ... lines 1 - 7
use Symfony\Component\Security\Core\Exception\AuthenticationException;
// ... lines 9 - 11
class CheckVerifiedUserSubscriber implements EventSubscriberInterface
{
public function onCheckPassport(CheckPassportEvent $event)
{
// ... lines 16 - 25
if (!$user->getIsVerified()) {
throw new AuthenticationException();
}
}
// ... lines 30 - 36
}
See Code Block in Script
// ... lines 1 - 8
use Symfony\Component\Security\Core\Exception\CustomUserMessageAuthenticationException;
// ... lines 10 - 12
class CheckVerifiedUserSubscriber implements EventSubscriberInterface
{
public function onCheckPassport(CheckPassportEvent $event)
// ... lines 16 - 26
if (!$user->getIsVerified()) {
throw new CustomUserMessageAuthenticationException(
'Please verify your account before logging in.'
);
}
}
// ... lines 33 - 39
}
See Code Block in Script
// ... lines 1 - 6
use Symfony\Component\Security\Core\Security;
// ... line 8
class BlameableSubscriber implements EventSubscriberInterface
{
private Security $security;
public function __construct(Security $security)
{
$this->security = $security;
}
// ... lines 17 - 28
}
See Code Block in Script
Hey Trafficmanagertech Inside your `security.yaml` file do you have a "main" key defined as your firewall? Cheers!
MolloKhan
MolloKhan
Read Full Comment
63 lines | src/Controller/SecurityController.php
// ... lines 1 - 6
use Scheb\TwoFactorBundle\Security\TwoFactor\QrCode\QrCodeGenerator;
// ... lines 8 - 13
class SecurityController extends BaseController
{
// ... lines 16 - 53
public function displayGoogleAuthenticatorQrCode(QrCodeGenerator $qrCodeGenerator)
{
// ... lines 56 - 60
}
}
See Code Block in Script
``` collectionOperations: [ 'get', 'post' => [ "security" => "is_granted('IS_AUTHENTICATED_ANONYMOUSLY')", 'validation_groups' => ['Default', 'create'] ] ],``` and ``` #[SerializedName('password')] /** * @Assert\NotBlank(groups={"create"}) */ private $plainPassword;``` also add return type above getPlainPassword function ``` /** * @return string */ public function getPlainPassword(): string { return $this->plainPassword; } ``` after setup this things…
31 lines | src/Controller/SecurityController.php
// ... lines 1 - 9
class SecurityController extends AbstractController
{
// ... lines 12 - 14
public function login(AuthenticationUtils $authenticationUtils): Response
{
return $this->render('security/login.html.twig', [
// ... line 18
'last_username' => $authenticationUtils->getLastUsername(),
]);
}
// ... lines 22 - 29
}
See Code Block in Script
22 lines | src/Controller/SecurityController.php
// ... lines 1 - 9
class SecurityController extends AbstractController
{
// ... lines 12 - 14
public function login(AuthenticationUtils $authenticationUtils): Response
{
return $this->render('security/login.html.twig', [
'error' => $authenticationUtils->getLastAuthenticationError(),
]);
}
}
See Code Block in Script
132 lines | src/Entity/User.php
// ... lines 1 - 7
use Symfony\Component\Security\Core\User\UserInterface;
// ... lines 9 - 12
class User implements UserInterface
{
// ... lines 15 - 130
}
See Code Block in Script
130 lines | src/Entity/User.php
// ... lines 1 - 6
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
// ... lines 8 - 12
class User implements UserInterface, PasswordAuthenticatedUserInterface
{
// ... lines 15 - 128
}
See Code Block in Script
22 lines | src/Controller/SecurityController.php
// ... lines 1 - 7
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
class SecurityController extends AbstractController
{
// ... lines 12 - 14
public function login(AuthenticationUtils $authenticationUtils): Response
{
// ... lines 17 - 19
}
}
See Code Block in Script
22 lines | src/Controller/SecurityController.php
// ... lines 1 - 9
class SecurityController extends AbstractController
{
// ... lines 12 - 14
public function login(AuthenticationUtils $authenticationUtils): Response
{
return $this->render('security/login.html.twig', [
'error' => $authenticationUtils->getLastAuthenticationError(),
]);
}
}
See Code Block in Script
21 lines | src/Controller/SecurityController.php
// ... lines 1 - 2
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
class SecurityController extends AbstractController
{
/**
* @Route("/security", name="security")
*/
public function index(): Response
{
return $this->render('security/index.html.twig', [
'controller_name' => 'SecurityController',
]);
}
}
See Code Block in Script
19 lines | src/Controller/SecurityController.php
// ... lines 1 - 8
class SecurityController extends AbstractController
{
/**
* @Route("/login", name="app_login")
*/
public function login(): Response
{
return $this->render('security/login.html.twig');
}
}
See Code Block in Script
115 lines | src/Entity/User.php
// ... lines 1 - 7
use Symfony\Component\Security\Core\User\UserInterface;
// ... lines 9 - 12
class User implements UserInterface
{
// ... lines 15 - 113
}
See Code Block in Script