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
explicitly set secret and uid for oauth application
ulferts2280feeece49
diff --git a/app/services/oauth/persist_application_service.rb b/app/services/oauth/persist_application_service.rbindex ec73b2310b2..a95f1554e7c 100644--- a/app/services/oauth/persist_application_service.rb+++ b/app/services/oauth/persist_application_service.rb@@ -42,6 +42,7 @@ module OAuthdef call(attributes)set_defaultsapplication.attributes = attributes+ set_secret_and_idresult, errors = validate_and_save(application, current_user)ServiceResult.new success: result, errors:, result: application@@ -53,5 +54,13 @@ module OAuthapplication.owner = current_userapplication.owner_type = 'User'end++ def set_secret_and_id+ application.extend(OpenProject::ChangedBySystem)+ application.change_by_system do+ application.renew_secret if application.secret.blank?+ application.uid = Doorkeeper::OAuth::Helpers::UniqueToken.generate if application.uid.blank?+ end+ endendend