Add possibility to create users with provider (such as LDAP)

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2021-07-22 15:09:12 +02:00
parent 395675ce6a
commit fa8cae681f
6 changed files with 133 additions and 25 deletions

View File

@@ -34,6 +34,9 @@ defmodule Mobilizon.Service.Auth.Authenticator do
@callback can_change_password?(User.t()) :: boolean
def can_change_password?(%User{} = user), do: implementation().can_change_password?(user)
@callback provider_name :: String.t() | nil
def provider_name, do: implementation().provider_name()
@spec has_password?(User.t()) :: boolean()
def has_password?(%User{provider: provider}), do: is_nil(provider) or provider == "ldap"