aboutsummaryrefslogtreecommitdiff
path: root/sources/patches/app-sso.patch
diff options
context:
space:
mode:
authorTagada <36127788+Tagadda@users.noreply.github.com>2023-09-25 22:19:01 +0200
committerGitHub <noreply@github.com>2023-09-25 22:19:01 +0200
commitfd5933b63a33c083585b916f75aba4c5efa5e98f (patch)
tree73255de0e2ed7beadbf66d29cfb4349c991c0f41 /sources/patches/app-sso.patch
parent0051a14832d4c6b10909f4220956342f926fb5c9 (diff)
parent2937d90ca34f7b78d7338605378b3e8e3b98e5c8 (diff)
downloadmastodon_ynh-fd5933b63a33c083585b916f75aba4c5efa5e98f.tar.gz
mastodon_ynh-fd5933b63a33c083585b916f75aba4c5efa5e98f.tar.bz2
mastodon_ynh-fd5933b63a33c083585b916f75aba4c5efa5e98f.zip
Merge pull request #414 from YunoHost-Apps/revert-413-revert-410-testing
Testing - Upgrade to v4.2.0 (#409)
Diffstat (limited to 'sources/patches/app-sso.patch')
-rw-r--r--sources/patches/app-sso.patch56
1 files changed, 0 insertions, 56 deletions
diff --git a/sources/patches/app-sso.patch b/sources/patches/app-sso.patch
deleted file mode 100644
index 72f738e..0000000
--- a/sources/patches/app-sso.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
-index 7c36bc6b8..3f691d102 100644
---- a/app/controllers/application_controller.rb
-+++ b/app/controllers/application_controller.rb
-@@ -69,7 +69,7 @@ class ApplicationController < ActionController::Base
- end
-
- def after_sign_out_path_for(_resource_or_scope)
-- new_user_session_path
-+ "https://#{File.read('/etc/yunohost/current_host')}/yunohost/sso/?action=logout"
- end
-
- protected
-diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb
-index 5232e6cfd..160348674 100644
---- a/config/initializers/devise.rb
-+++ b/config/initializers/devise.rb
-@@ -180,7 +180,7 @@ Devise.setup do |config|
- # given strategies, for example, `config.http_authenticatable = [:database]` will
- # enable it only for database authentication. The supported strategies are:
- # :database = Support basic authentication with authentication key + password
-- config.http_authenticatable = [:pam, :database]
-+ config.http_authenticatable = [:two_factor_ldap, :pam, :database]
-
- # If 401 status code should be returned for AJAX requests. True by default.
- # config.http_authenticatable_on_xhr = true
-diff --git a/lib/devise/two_factor_ldap_authenticatable.rb b/lib/devise/two_factor_ldap_authenticatable.rb
-index 065aa2de8..0eb4be10c 100644
---- a/lib/devise/two_factor_ldap_authenticatable.rb
-+++ b/lib/devise/two_factor_ldap_authenticatable.rb
-@@ -5,13 +5,13 @@ require 'devise/strategies/base'
-
- module Devise
- module Strategies
-- class TwoFactorLdapAuthenticatable < Base
-+ class TwoFactorLdapAuthenticatable < Authenticatable
- def valid?
-- valid_params? && mapping.to.respond_to?(:authenticate_with_ldap)
-+ (valid_for_params_auth? || valid_for_http_auth?) && mapping.to.respond_to?(:authenticate_with_ldap)
- end
-
- def authenticate!
-- resource = mapping.to.authenticate_with_ldap(params[scope])
-+ resource = mapping.to.authenticate_with_ldap(authentication_hash.merge(:password => password))
-
- if resource && !resource.otp_required_for_login?
- success!(resource)
-@@ -23,7 +23,7 @@ module Devise
- protected
-
- def valid_params?
-- params[scope] && params[scope][:password].present?
-+ super && params[scope][:password].present?
- end
- end
- end