-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #121 from phiggins/member-logins-test
Kenny Logins
- Loading branch information
Showing
32 changed files
with
538 additions
and
108 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
2.0.0-p598 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,13 @@ | ||
class ApplicationController < ActionController::Base | ||
before_action :configure_permitted_parameters, if: :devise_controller? | ||
|
||
# filter_parameter_logging :password | ||
helper :all | ||
protect_from_forgery | ||
|
||
protected | ||
|
||
def configure_permitted_parameters | ||
devise_parameter_sanitizer.for(:sign_up).push(:username, :name, :email, :twitter, :github, :ruby_gems_id, :website, :bio) | ||
end | ||
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,65 @@ | ||
class Members::RegistrationsController < Devise::RegistrationsController | ||
# before_filter :configure_sign_up_params, only: [:create] | ||
# before_filter :configure_account_update_params, only: [:update] | ||
before_filter :spam_trap, only: :create | ||
|
||
def spam_trap | ||
redirect_to members_url and return if sign_up_params[:username].present? | ||
end | ||
|
||
# GET /resource/sign_up | ||
# def new | ||
# super | ||
# end | ||
|
||
# POST /resource | ||
# def create | ||
# super | ||
# end | ||
|
||
# GET /resource/edit | ||
# def edit | ||
# super | ||
# end | ||
|
||
# PUT /resource | ||
# def update | ||
# super | ||
# end | ||
|
||
# DELETE /resource | ||
# def destroy | ||
# super | ||
# end | ||
|
||
# GET /resource/cancel | ||
# Forces the session data which is usually expired after sign | ||
# in to be expired now. This is useful if the user wants to | ||
# cancel oauth signing in/up in the middle of the process, | ||
# removing all OAuth session data. | ||
# def cancel | ||
# super | ||
# end | ||
|
||
# protected | ||
|
||
# You can put the params you want to permit in the empty array. | ||
# def configure_sign_up_params | ||
# devise_parameter_sanitizer.for(:sign_up) << :attribute | ||
# end | ||
|
||
# You can put the params you want to permit in the empty array. | ||
# def configure_account_update_params | ||
# devise_parameter_sanitizer.for(:account_update) << :attribute | ||
# end | ||
|
||
# The path used after sign up. | ||
def after_sign_up_path_for(resource) | ||
members_path | ||
end | ||
|
||
# The path used after sign up for inactive accounts. | ||
# def after_inactive_sign_up_path_for(resource) | ||
# super(resource) | ||
# end | ||
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<h1>Edit Your Profile</h1> | ||
|
||
<%= render 'form' %> | ||
<%= link_to 'Back', member_path %> |
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
8 changes: 8 additions & 0 deletions
8
app/views/members/mailer/reset_password_instructions.html.erb
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,8 @@ | ||
<p>Hello <%= @resource.email %>!</p> | ||
|
||
<p>Someone has requested a link to change your password. You can do this through the link below.</p> | ||
|
||
<p><%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %></p> | ||
|
||
<p>If you didn't request this, please ignore this email.</p> | ||
<p>Your password won't change until you access the link above and create a new one.</p> |
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,22 @@ | ||
<h2>Change your password</h2> | ||
|
||
<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %> | ||
<%= devise_error_messages! %> | ||
<%= f.hidden_field :reset_password_token %> | ||
|
||
<div class="field"> | ||
<%= f.label :password, "New password" %><br /> | ||
<%= f.password_field :password, autofocus: true, autocomplete: "off" %> | ||
</div> | ||
|
||
<div class="field"> | ||
<%= f.label :password_confirmation, "Confirm new password" %><br /> | ||
<%= f.password_field :password_confirmation, autocomplete: "off" %> | ||
</div> | ||
|
||
<div class="actions"> | ||
<%= f.submit "Change my password" %> | ||
</div> | ||
<% end %> | ||
<%= render "members/shared/links" %> |
Oops, something went wrong.