<commit_before>defmodule Gebetsgruppe.SessionController do
  use Gebetsgruppe.Web, :controller

  alias Gebetsgruppe.Bruder

  def new(conn, params) do
    changeset = Bruder.login_changeset(%Bruder{})
    render(conn, Gebetsgruppe.SessionView, "new.html", changeset: changeset)
  end

  def create(conn, params = %{}) do
    user = Repo.one(BruderQuery.by_email(params["user"]["email"] || ""))
    if user do
      changeset = Bruder.login_changeset(user, params["user"])
      if changeset.valid? do
        conn
        |> put_flash(:info, "Logged in.")
        |> Guardian.Plug.sign_in(user, :token)
        |> redirect(to: user_path(conn, :index))
      else<commit_msg>fix up a warning, this is probably going to change a bit.<commit_after>defmodule Gebetsgruppe.SessionController do
  use Gebetsgruppe.Web, :controller

  alias Gebetsgruppe.Bruder

  def new(conn, _) do
    changeset = Bruder.login_changeset(%Bruder{})
    render(conn, Gebetsgruppe.SessionView, "new.html", changeset: changeset)
  end

  def create(conn, params = %{}) do
    user = Repo.one(BruderQuery.by_email(params["user"]["email"] || ""))
    if user do
      changeset = Bruder.login_changeset(user, params["user"])
      if changeset.valid? do
        conn
        |> put_flash(:info, "Logged in.")
        |> Guardian.Plug.sign_in(user, :token)
        |> redirect(to: user_path(conn, :index))
      else
{'fraction_non_alphanumeric': 0.13246940244780417, 'fraction_numerical': 0.0, 'mean_word_length': 3.557377049180328, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '6597762', 'n_tokens_mistral': 469, 'n_tokens_neox': 466, 'n_words': 99}