OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
[#43653] fixed auth state with invalid client tokens
Eric Schubert36f68a733656
diff --git a/app/services/oauth_clients/connection_manager.rb b/app/services/oauth_clients/connection_manager.rbindex 60373dd6b00..aa0422df0d1 100644--- a/app/services/oauth_clients/connection_manager.rb+++ b/app/services/oauth_clients/connection_manager.rb@@ -132,7 +132,7 @@ module OAuthClientsservice_result = refresh_token # `refresh_token` already has exception handlingreturn :connected if service_result.success?- if service_result.result == 'invalid_grant'+ if service_result.result == 'invalid_request'# This can happen if the Authorization Server invalidated all tokens.# Then the user would ideally be asked to reauthorize.:failed_authorizationdiff --git a/spec/services/oauth_clients/connection_manager_spec.rb b/spec/services/oauth_clients/connection_manager_spec.rbindex 6ae30c63c5e..194536ae4a6 100644--- a/spec/services/oauth_clients/connection_manager_spec.rb+++ b/spec/services/oauth_clients/connection_manager_spec.rb@@ -427,7 +427,7 @@ describe ::OAuthClients::ConnectionManager, type: :model doendcontext 'with invalid refresh token' do- let(:refresh_service_result) { ServiceResult.failure(result: 'invalid_grant') }+ let(:refresh_service_result) { ServiceResult.failure(result: 'invalid_request') }it 'refreshes the access token and returns :failed_authorization' doexpect(subject).to eq :failed_authorization