Beispiel #1
0
function ajax_signup()
{
    if (Auth::check()) {
        exit;
    }
    $email = isset($_POST['email']) ? $_POST['email'] : '';
    $password = isset($_POST['pass1']) ? $_POST['pass1'] : '';
    Register::signup($_POST);
    if (Register::passes()) {
        if (Config::get('auth.email_activation')) {
            Session::flash('signup_complete', true);
            json_message(true);
        } else {
            Auth::login($email, $password);
            json_message(array('redirect' => Config::get('auth.login_redirect')));
        }
    } else {
        json_message(Register::errors()->toArray(), false);
    }
}