fix bug with public registration
This commit is contained in:
parent
f990fafc6a
commit
1726a1b72e
@ -1,3 +1,6 @@
|
|||||||
|
# v0.1.8
|
||||||
|
- Fix bug with public registration
|
||||||
|
|
||||||
# v0.1.7
|
# v0.1.7
|
||||||
- Update dependencies
|
- Update dependencies
|
||||||
- Show topbar on form submit/page refresh
|
- Show topbar on form submit/page refresh
|
||||||
|
@ -11,6 +11,8 @@ config :memex,
|
|||||||
ecto_repos: [Memex.Repo],
|
ecto_repos: [Memex.Repo],
|
||||||
generators: [binary_id: true]
|
generators: [binary_id: true]
|
||||||
|
|
||||||
|
config :memex, Memex.Accounts, registration: System.get_env("REGISTRATION", "invite")
|
||||||
|
|
||||||
# Configures the endpoint
|
# Configures the endpoint
|
||||||
config :memex, MemexWeb.Endpoint,
|
config :memex, MemexWeb.Endpoint,
|
||||||
url: [scheme: "https", host: System.get_env("HOST") || "localhost", port: "443"],
|
url: [scheme: "https", host: System.get_env("HOST") || "localhost", port: "443"],
|
||||||
@ -18,8 +20,7 @@ config :memex, MemexWeb.Endpoint,
|
|||||||
secret_key_base: "KH59P0iZixX5gP/u+zkxxG8vAAj6vgt0YqnwEB5JP5K+E567SsqkCz69uWShjE7I",
|
secret_key_base: "KH59P0iZixX5gP/u+zkxxG8vAAj6vgt0YqnwEB5JP5K+E567SsqkCz69uWShjE7I",
|
||||||
render_errors: [view: MemexWeb.ErrorView, accepts: ~w(html json), layout: false],
|
render_errors: [view: MemexWeb.ErrorView, accepts: ~w(html json), layout: false],
|
||||||
pubsub_server: Memex.PubSub,
|
pubsub_server: Memex.PubSub,
|
||||||
live_view: [signing_salt: "zOLgd3lr"],
|
live_view: [signing_salt: "zOLgd3lr"]
|
||||||
registration: System.get_env("REGISTRATION") || "invite"
|
|
||||||
|
|
||||||
config :memex, Memex.Application, automigrate: false
|
config :memex, Memex.Application, automigrate: false
|
||||||
|
|
||||||
|
@ -42,6 +42,8 @@ config :memex, Memex.Repo,
|
|||||||
pool_size: String.to_integer(System.get_env("POOL_SIZE", "10")),
|
pool_size: String.to_integer(System.get_env("POOL_SIZE", "10")),
|
||||||
socket_options: maybe_ipv6
|
socket_options: maybe_ipv6
|
||||||
|
|
||||||
|
config :memex, Memex.Accounts, registration: System.get_env("REGISTRATION", "invite")
|
||||||
|
|
||||||
config :memex, MemexWeb.Endpoint,
|
config :memex, MemexWeb.Endpoint,
|
||||||
url: [scheme: "https", host: host, port: 443],
|
url: [scheme: "https", host: host, port: 443],
|
||||||
http: [
|
http: [
|
||||||
@ -50,8 +52,7 @@ config :memex, MemexWeb.Endpoint,
|
|||||||
ip: interface,
|
ip: interface,
|
||||||
port: String.to_integer(System.get_env("PORT", "4000"))
|
port: String.to_integer(System.get_env("PORT", "4000"))
|
||||||
],
|
],
|
||||||
server: true,
|
server: true
|
||||||
registration: System.get_env("REGISTRATION", "invite")
|
|
||||||
|
|
||||||
if config_env() == :prod do
|
if config_env() == :prod do
|
||||||
# The secret key base is used to sign/encrypt cookies and other secrets.
|
# The secret key base is used to sign/encrypt cookies and other secrets.
|
||||||
|
@ -384,7 +384,7 @@ defmodule Memex.Accounts do
|
|||||||
"""
|
"""
|
||||||
@spec allow_registration?() :: boolean()
|
@spec allow_registration?() :: boolean()
|
||||||
def allow_registration? do
|
def allow_registration? do
|
||||||
Application.get_env(:Memex, MemexWeb.Endpoint)[:registration] == "public" or
|
Application.get_env(:memex, Memex.Accounts)[:registration] == "public" or
|
||||||
list_users_by_role(:admin) |> Enum.empty?()
|
list_users_by_role(:admin) |> Enum.empty?()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -109,8 +109,7 @@
|
|||||||
<li class="flex flex-row justify-center space-x-2">
|
<li class="flex flex-row justify-center space-x-2">
|
||||||
<b><%= gettext("registration:") %></b>
|
<b><%= gettext("registration:") %></b>
|
||||||
<p>
|
<p>
|
||||||
<%= Application.get_env(:memex, Endpoint)[:registration]
|
<%= case Application.get_env(:memex, Memex.Accounts)[:registration] do
|
||||||
|> case do
|
|
||||||
"public" -> gettext("public signups")
|
"public" -> gettext("public signups")
|
||||||
_ -> gettext("invite only")
|
_ -> gettext("invite only")
|
||||||
end %>
|
end %>
|
||||||
|
2
mix.exs
2
mix.exs
@ -4,7 +4,7 @@ defmodule Memex.MixProject do
|
|||||||
def project do
|
def project do
|
||||||
[
|
[
|
||||||
app: :memex,
|
app: :memex,
|
||||||
version: "0.1.7",
|
version: "0.1.8",
|
||||||
elixir: "~> 1.14",
|
elixir: "~> 1.14",
|
||||||
elixirc_paths: elixirc_paths(Mix.env()),
|
elixirc_paths: elixirc_paths(Mix.env()),
|
||||||
compilers: Mix.compilers(),
|
compilers: Mix.compilers(),
|
||||||
|
@ -163,12 +163,12 @@ msgstr ""
|
|||||||
msgid "features"
|
msgid "features"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: lib/memex_web/live/home_live.html.heex:138
|
#: lib/memex_web/live/home_live.html.heex:137
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "get involved!"
|
msgid "get involved!"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: lib/memex_web/live/home_live.html.heex:159
|
#: lib/memex_web/live/home_live.html.heex:158
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "help translate"
|
msgid "help translate"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
@ -183,7 +183,7 @@ msgstr ""
|
|||||||
msgid "invite disabled"
|
msgid "invite disabled"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: lib/memex_web/live/home_live.html.heex:115
|
#: lib/memex_web/live/home_live.html.heex:114
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "invite only"
|
msgid "invite only"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
@ -266,7 +266,7 @@ msgstr ""
|
|||||||
msgid "provide context around a single topic and hotlink to your notes"
|
msgid "provide context around a single topic and hotlink to your notes"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: lib/memex_web/live/home_live.html.heex:114
|
#: lib/memex_web/live/home_live.html.heex:113
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "public signups"
|
msgid "public signups"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
@ -281,7 +281,7 @@ msgstr ""
|
|||||||
msgid "registration:"
|
msgid "registration:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: lib/memex_web/live/home_live.html.heex:170
|
#: lib/memex_web/live/home_live.html.heex:169
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "report bugs or request features"
|
msgid "report bugs or request features"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
@ -330,12 +330,12 @@ msgstr ""
|
|||||||
msgid "users"
|
msgid "users"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: lib/memex_web/live/home_live.html.heex:121
|
#: lib/memex_web/live/home_live.html.heex:120
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "version:"
|
msgid "version:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: lib/memex_web/live/home_live.html.heex:148
|
#: lib/memex_web/live/home_live.html.heex:147
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "view the source code"
|
msgid "view the source code"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -152,12 +152,12 @@ msgstr ""
|
|||||||
msgid "features"
|
msgid "features"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: lib/memex_web/live/home_live.html.heex:138
|
#: lib/memex_web/live/home_live.html.heex:137
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "get involved!"
|
msgid "get involved!"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: lib/memex_web/live/home_live.html.heex:159
|
#: lib/memex_web/live/home_live.html.heex:158
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "help translate"
|
msgid "help translate"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
@ -172,7 +172,7 @@ msgstr ""
|
|||||||
msgid "invite disabled"
|
msgid "invite disabled"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: lib/memex_web/live/home_live.html.heex:115
|
#: lib/memex_web/live/home_live.html.heex:114
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "invite only"
|
msgid "invite only"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
@ -255,7 +255,7 @@ msgstr ""
|
|||||||
msgid "provide context around a single topic and hotlink to your notes"
|
msgid "provide context around a single topic and hotlink to your notes"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: lib/memex_web/live/home_live.html.heex:114
|
#: lib/memex_web/live/home_live.html.heex:113
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "public signups"
|
msgid "public signups"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
@ -270,7 +270,7 @@ msgstr ""
|
|||||||
msgid "registration:"
|
msgid "registration:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: lib/memex_web/live/home_live.html.heex:170
|
#: lib/memex_web/live/home_live.html.heex:169
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "report bugs or request features"
|
msgid "report bugs or request features"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
@ -319,12 +319,12 @@ msgstr ""
|
|||||||
msgid "users"
|
msgid "users"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: lib/memex_web/live/home_live.html.heex:121
|
#: lib/memex_web/live/home_live.html.heex:120
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "version:"
|
msgid "version:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: lib/memex_web/live/home_live.html.heex:148
|
#: lib/memex_web/live/home_live.html.heex:147
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "view the source code"
|
msgid "view the source code"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
Loading…
Reference in New Issue
Block a user