-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add basic Pow configuration (with Pow 1.0.21)
- Loading branch information
1 parent
46407cb
commit c208484
Showing
15 changed files
with
139 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,3 +35,4 @@ npm-debug.log | |
.elixir_ls | ||
/config/dev.secret.exs | ||
/config/test.secret.exs | ||
/Mnesia.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
lib/curious_messenger_web/templates/pow/registration/edit.html.eex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<h1>Edit profile</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, :current_password %> | ||
<%= password_input f, :current_password %> | ||
<%= error_tag f, :current_password %> | ||
|
||
<%= label f, :nickname %> | ||
<%= text_input f, :nickname %> | ||
<%= error_tag f, :nickname %> | ||
|
||
<%= 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 "Update" %> | ||
</div> | ||
<% end %> | ||
|
32 changes: 32 additions & 0 deletions
32
lib/curious_messenger_web/templates/pow/registration/new.html.eex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<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, :nickname %> | ||
<%= text_input f, :nickname %> | ||
<%= error_tag f, :nickname %> | ||
|
||
<%= 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> |
24 changes: 24 additions & 0 deletions
24
lib/curious_messenger_web/templates/pow/session/new.html.eex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<h1>Sign in</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 %> | ||
|
||
<div> | ||
<%= submit "Sign in" %> | ||
</div> | ||
<% end %> | ||
|
||
|
||
<span><%= link "Register", to: Routes.pow_registration_path(@conn, :new) %></span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
defmodule CuriousMessengerWeb.Pow.RegistrationView do | ||
use CuriousMessengerWeb, :view | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
defmodule CuriousMessengerWeb.Pow.SessionView do | ||
use CuriousMessengerWeb, :view | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
priv/repo/migrations/20191112214037_add_pow_fields_to_users.exs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
defmodule CuriousMessenger.Repo.Migrations.AddPowFieldsToUsers do | ||
use Ecto.Migration | ||
|
||
def change do | ||
alter table(:auth_users) do | ||
add :email, :string, null: false | ||
add :password_hash, :string | ||
end | ||
|
||
create unique_index(:auth_users, [:email]) | ||
end | ||
end |