# User Authentication ## Create a user class Permissions are linked to a user object. ```bash php bin/console make:user ``` Now you will want to sync the databse ```bash php bin/console make:migration php bin/console doctrine:migrations:migrate ``` ## Registration Form You can use maker to do this (symfonycasts/verify-email-bundle must be installed, which is done through the install script) ```bash php bin/console make:registration-form ``` ## Login Form ```php bin/console make:controller Login``` You have to add ```yaml form_login: login_path: app_login check_path: app_login ``` to the firewalls section of config/packages/security.yaml ### Modify the controller ```php getLastAuthenticationError(); $lastUsername = $authenticationUtils->getLastUsername(); return $this->render('login/index.html.twig', [ 'last_username' => $lastUsername, 'error' => $error, ]); } } ``` ### Modify the template ```php {% extends '@nytwig/master.html.twig' %} {% block title %}Hello LoginController!{% endblock %} {% block content %} {% if error %}