Allow disabling registration, add Interactive module with tools

This commit is contained in:
bluepython508
2023-11-10 21:24:32 +00:00
parent 92edb025fb
commit 4107d37106
2 changed files with 48 additions and 0 deletions

View File

@@ -60,6 +60,7 @@ defmodule SsoBsn.Accounts do
"""
def register_user(attrs) do
if not Application.get_env(:sso_bsn, :enable_registration, false), do: raise "Cannot register a user: disabled"
%User{}
|> User.registration_changeset(attrs)
|> Repo.insert()