Spec fixes

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2021-10-05 17:43:45 +02:00
parent 76bc409f68
commit dee7c58449
33 changed files with 193 additions and 234 deletions

View File

@@ -191,14 +191,10 @@ defmodule Mobilizon.Service.Auth.LDAPAuthenticator do
])
end
@spec register_user(String.t()) :: User.t() | any()
@spec register_user(String.t()) :: User.t() | {:error, Ecto.Changeset.t()}
defp register_user(email) do
case Users.create_external(email, "ldap") do
{:ok, %User{} = user} ->
user
error ->
error
with {:ok, %User{} = user} <- Users.create_external(email, "ldap") do
user
end
end