giant massive dep upgrade and dialyxir-found error emporium (#371)
[akkoma] / lib / pleroma / web / auth / pleroma_authenticator.ex
index 68472e75f7c1e6d562b8cd5e8684ece190ffa08e..bb377d68666ad9d317512974bcbf2e85c7a2018d 100644 (file)
@@ -60,6 +60,8 @@ defmodule Pleroma.Web.Auth.PleromaAuthenticator do
   def get_registration(%Plug.Conn{} = _conn), do: {:error, :missing_credentials}
 
   @doc "Creates Pleroma.User record basing on params and Pleroma.Registration record."
+  @spec create_from_registration(Plug.Conn.t(), Registration.t()) ::
+          {:ok, User.t()} | {:error, any()}
   def create_from_registration(
         %Plug.Conn{params: %{"authorization" => registration_attrs}},
         %Registration{} = registration
@@ -89,6 +91,8 @@ defmodule Pleroma.Web.Auth.PleromaAuthenticator do
          {:ok, _} <-
            Registration.changeset(registration, %{user_id: new_user.id}) |> Repo.update() do
       {:ok, new_user}
+    else
+      err -> err
     end
   end