2023-10-21 17:44:04 +03:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
|
|
class PasswordsController < Devise::PasswordsController
|
2025-09-05 21:48:22 +03:00
|
|
|
# rubocop:disable Rails/LexicallyScopedActionFilter
|
|
|
|
|
skip_before_action :require_no_authentication, only: %i[edit update]
|
|
|
|
|
# rubocop:enable Rails/LexicallyScopedActionFilter
|
|
|
|
|
|
2025-12-02 14:25:45 +02:00
|
|
|
around_action :with_browser_locale
|
|
|
|
|
|
2023-10-21 17:44:04 +03:00
|
|
|
class Current < ActiveSupport::CurrentAttributes
|
|
|
|
|
attribute :user
|
|
|
|
|
end
|
|
|
|
|
|
2024-03-29 14:50:18 +02:00
|
|
|
def create
|
|
|
|
|
super do |resource|
|
|
|
|
|
resource.errors.clear unless Docuseal.multitenant?
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
2023-10-21 17:44:04 +03:00
|
|
|
def update
|
|
|
|
|
super do |resource|
|
|
|
|
|
Current.user = resource
|
|
|
|
|
end
|
|
|
|
|
end
|
2025-09-06 11:10:45 +03:00
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
|
|
def after_resetting_password_path_for(_)
|
|
|
|
|
new_session_path(resource_name)
|
|
|
|
|
end
|
2023-10-21 17:44:04 +03:00
|
|
|
end
|