diff --git a/app/controllers/partners/passwords_controller.rb b/app/controllers/partners/passwords_controller.rb
index 29013456..49732f1c 100644
--- a/app/controllers/partners/passwords_controller.rb
+++ b/app/controllers/partners/passwords_controller.rb
@@ -2,33 +2,33 @@
class Partners::PasswordsController < Devise::PasswordsController
# GET /resource/password/new
- # def new
- # super
- # end
+ def new
+ super
+ end
# POST /resource/password
- # def create
- # super
- # end
+ def create
+ super
+ end
# GET /resource/password/edit?reset_password_token=abcdef
- # def edit
- # super
- # end
+ def edit
+ super
+ end
# PUT /resource/password
- # def update
- # super
- # end
+ def update
+ super
+ end
# protected
- # def after_resetting_password_path_for(resource)
- # super(resource)
- # end
+ def after_resetting_password_path_for(resource)
+ super(resource)
+ end
# The path used after sending reset password instructions
- # def after_sending_reset_password_instructions_path_for(resource_name)
- # super(resource_name)
- # end
+ def after_sending_reset_password_instructions_path_for(resource_name)
+ super(resource_name)
+ end
end
diff --git a/app/controllers/partners/registrations_controller.rb b/app/controllers/partners/registrations_controller.rb
index 4b3e0996..7c0be17e 100644
--- a/app/controllers/partners/registrations_controller.rb
+++ b/app/controllers/partners/registrations_controller.rb
@@ -1,62 +1,64 @@
# frozen_string_literal: true
class Partners::RegistrationsController < Devise::RegistrationsController
- # before_action :configure_sign_up_params, only: [:create]
- # before_action :configure_account_update_params, only: [:update]
+ before_action :configure_sign_up_params, only: [:create]
+ before_action :configure_account_update_params, only: [:update]
+ layout "new_registration", only: [:new, :create]
+ layout "edit_registration", only: [:edit, :update]
# GET /resource/sign_up
- # def new
- # super
- # end
+ def new
+ super
+ end
# POST /resource
- # def create
- # super
- # end
+ def create
+ super
+ end
# GET /resource/edit
- # def edit
- # super
- # end
+ def edit
+ super
+ end
# PUT /resource
- # def update
- # super
- # end
+ def update
+ super
+ end
# DELETE /resource
- # def destroy
- # super
- # end
+ 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
+ def cancel
+ super
+ end
# protected
# If you have extra params to permit, append them to the sanitizer.
- # def configure_sign_up_params
- # devise_parameter_sanitizer.permit(:sign_up, keys: [:attribute])
- # end
+ def configure_sign_up_params
+ devise_parameter_sanitizer.permit(:sign_up, keys: [:attribute])
+ end
# If you have extra params to permit, append them to the sanitizer.
- # def configure_account_update_params
- # devise_parameter_sanitizer.permit(:account_update, keys: [:attribute])
- # end
+ def configure_account_update_params
+ devise_parameter_sanitizer.permit(:account_update, keys: [:attribute])
+ end
# The path used after sign up.
- # def after_sign_up_path_for(resource)
- # super(resource)
- # end
+ def after_sign_up_path_for(resource)
+ super(resource)
+ end
# The path used after sign up for inactive accounts.
- # def after_inactive_sign_up_path_for(resource)
- # super(resource)
- # end
+ def after_inactive_sign_up_path_for(resource)
+ super(resource)
+ end
end
diff --git a/app/models/partner.rb b/app/models/partner.rb
index 58dde174..ee5f0945 100644
--- a/app/models/partner.rb
+++ b/app/models/partner.rb
@@ -2,7 +2,7 @@ class Partner < ApplicationRecord
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable
devise :invitable, :database_authenticatable,
- :recoverable, :rememberable, :trackable, :validatable
+ :recoverable, :rememberable, :trackable, :validatable, :registerable
include DiaperBankClient
diff --git a/app/views/devise/passwords/edit.html.erb b/app/views/devise/passwords/edit.html.erb
index 6a796b05..442036a7 100644
--- a/app/views/devise/passwords/edit.html.erb
+++ b/app/views/devise/passwords/edit.html.erb
@@ -9,7 +9,7 @@
<% if @minimum_password_length %>
(<%= @minimum_password_length %> characters minimum)
<% end %>
- <%= f.password_field :password, autofocus: true, autocomplete: "off" %>
+ <%= f.password_field :password, autofocus: true, autocomplete: "new-password" %>
Unhappy? <%= button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete %>
+Unhappy? <%= button_to "Cancel my account", partner_registration_path, data: { confirm: "Are you sure?" }, method: :delete %>
<%= link_to "Back", :back %> diff --git a/app/views/devise/registrations/new.html.erb b/app/views/devise/registrations/new.html.erb index 602803cf..9192a414 100644 --- a/app/views/devise/registrations/new.html.erb +++ b/app/views/devise/registrations/new.html.erb @@ -1,6 +1,6 @@