Browse Source

disable registrations

master
Inhji Y. 2 years ago
parent
commit
337b4b8029
  1. 10
      lib/dagon_web/router.ex
  2. 28
      lib/dagon_web/templates/pow/registration/new.html.eex
  3. 6
      lib/dagon_web/templates/pow/session/new.html.eex

10
lib/dagon_web/router.ex

@ -18,7 +18,15 @@ defmodule DagonWeb.Router do
scope "/" do
pipe_through :browser
pow_routes()
pow_session_routes()
end
scope "/", Pow.Phoenix, as: "pow" do
pipe_through [:browser, :protected]
resources "/registration", RegistrationController,
singleton: true,
only: [:edit, :update, :delete]
end
scope "/", DagonWeb do

28
lib/dagon_web/templates/pow/registration/new.html.eex

@ -1,28 +0,0 @@
<h1>Register</h1>
<%= form_for @changeset, @action, [as: :user], fn f -> %>
<%= if @changeset.action do %>
<div class="alert alert-danger">
<p>Oops, something went wrong! Please check the errors below.</p>
</div>
<% end %>
<%= label f, Pow.Ecto.Schema.user_id_field(@changeset) %>
<%= text_input f, Pow.Ecto.Schema.user_id_field(@changeset) %>
<%= error_tag f, Pow.Ecto.Schema.user_id_field(@changeset) %>
<%= label f, :password %>
<%= password_input f, :password %>
<%= error_tag f, :password %>
<%= label f, :confirm_password %>
<%= password_input f, :confirm_password %>
<%= error_tag f, :confirm_password %>
<div>
<%= submit "Register" %>
</div>
<% end %>
<span><%= link "Sign in", to: Routes.pow_session_path(@conn, :new) %></span>

6
lib/dagon_web/templates/pow/session/new.html.eex

@ -23,11 +23,7 @@
<div class="field is-grouped">
<div class="control">
<%= submit "Sign in", class: "button is-primary" %>
</div>
<div class="control">
<%= link "Register", to: Routes.pow_registration_path(@conn, :new), class: "button" %>
<%= submit "Sign in", class: "button is-primary" %>
</div>
</div>
<% end %>

Loading…
Cancel
Save