db::escape($email) ]); if(!$user) throw new Exception("Account not found."); if(!password_verify($password, $user->password)) throw new Exception("Password is incorrect."); $_SESSION["user_id"] = $user->id; $redirect = $_SESSION["log_in_redirect_uri"] ?? "/account"; Core::addAlert("success", "Log in successful."); HTTP::redirect($redirect); } catch(Exception $e) { Core::addAlert("danger", $e->getMessage()); } } View::includeOnce("header", compact("page_title")); View::include("log_in"); View::includeOnce("footer"); ?>