<commit_before><?php

namespace FluxBB\Web\Controllers;

use FluxBB\Server\Exception\Exception;
use FluxBB\Server\Exception\ValidationFailed;
use FluxBB\Web\Controller;

class AuthController extends Controller
{
    public function registerForm()
    {
        return $this->view('register');
    }

    public function register()
    {
        try {
            $this->execute('handle_registration', [
                'ip' => $this->request->getClientIp(),
            ]);

            return $this->redirectTo('index')
                        ->withMessage(trans('fluxbb::register.reg_complete'));
        } catch (ValidationFailed $e) {
            return $this->redirectTo('register')
                        ->withInput()
                        ->withErrors($e);
        }
    }

    public function loginForm()
    {
        return $this->view('login');
    }

    public function login()
    {
        try {
            $this->execute('handle_login');

            return $this->redirectTo('index')
                        ->withMessage(trans('fluxbb::login.message_login'));
        } catch (Exception $e) {
            return $this->redirectTo('login')
                        ->withInput();
            // TODO: With errors!
        }
    }

    public function logout()
    {
        $this->execute('logout');

        return $this->redirectTo('index');
    }

    public function resetForm()
    {
        //
    }

    public function reset()
    {
        //
    }
}<commit_msg>Add a redirect message when logging out.<commit_after><?php

namespace FluxBB\Web\Controllers;

use FluxBB\Server\Exception\Exception;
use FluxBB\Server\Exception\ValidationFailed;
use FluxBB\Web\Controller;

class AuthController extends Controller
{
    public function registerForm()
    {
        return $this->view('register');
    }

    public function register()
    {
        try {
            $this->execute('handle_registration', [
                'ip' => $this->request->getClientIp(),
            ]);

            return $this->redirectTo('index')
                        ->withMessage(trans('fluxbb::register.reg_complete'));
        } catch (ValidationFailed $e) {
            return $this->redirectTo('register')
                        ->withInput()
                        ->withErrors($e);
        }
    }

    public function loginForm()
    {
        return $this->view('login');
    }

    public function login()
    {
        try {
            $this->execute('handle_login');

            return $this->redirectTo('index')
                        ->withMessage(trans('fluxbb::login.message_login'));
        } catch (Exception $e) {
            return $this->redirectTo('login')
                        ->withInput();
            // TODO: With errors!
        }
    }

    public function logout()
    {
        $this->execute('logout');

        return $this->redirectTo('index')
                    ->withMessage('Successfully logged out.');
    }

    public function resetForm()
    {
        //
    }

    public function reset()
    {
        //
    }
}
{'fraction_non_alphanumeric': 0.13333333333333333, 'fraction_numerical': 0.0, 'mean_word_length': 1.6817785527462947, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 40, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7543151', 'n_tokens_mistral': 825, 'n_tokens_neox': 791, 'n_words': 147}