# Login

To access the other pages the user needs to be logged into his account.

If you are not logged in you can only access the Login page or the Sign Up page. The default url takes you to the Login page. Logging in is possible with already existing credentials. An email and a password must pe provided to log into your account.

The `App/Http/Controllers/SessionsController.php` handles the logging in of an existing user.

                    public function store()
                    {
                        $attributes = request()->validate([
                            'email' => 'required|email',
                            'password' => 'required'
                        ]);

                        if (! auth()->attempt($attributes)) {
                            throw ValidationException::withMessages([
                                'email' => 'Your provided credentials could not be verified.'
                            ]);
                        }

                        session()->regenerate();

                        return redirect('/dashboard');

                    }

If the user forgot his password he can reset the password or if he doesn't have an account he can sign up.