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

@@ -11,6 +11,7 @@ defmodule Mobilizon.Service.Auth.MobilizonAuthenticator do
@behaviour Authenticator
@impl Authenticator
def login(email, password) do
require Logger
@@ -33,7 +34,12 @@ defmodule Mobilizon.Service.Auth.MobilizonAuthenticator do
end
end
@impl Authenticator
def can_change_email?(%User{provider: provider}), do: is_nil(provider)
@impl Authenticator
def can_change_password?(%User{provider: provider}), do: is_nil(provider)
@impl Authenticator
def provider_name, do: nil
end