summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authortiagonbotelho <tiagonbotelho@hotmail.com>2016-10-18 19:03:31 +0100
committertiagonbotelho <tiagonbotelho@hotmail.com>2016-11-07 15:56:18 +0000
commit011e561bfa227f3ecbafe5b1ffd51700c680a15f (patch)
tree58af709e0f38dbfd7d389e2c3ad5516507ca2946 /app/controllers
parent9d51421346178c9189ffb47189f51d573ab42822 (diff)
downloadgitlab-ce-use-separate-token-for-incoming-email.tar.gz
implements reset incoming email token on issues modal and account page,use-separate-token-for-incoming-email
reactivates all tests and writes more tests for it
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/profiles_controller.rb4
-rw-r--r--app/controllers/projects_controller.rb7
2 files changed, 9 insertions, 2 deletions
diff --git a/app/controllers/profiles_controller.rb b/app/controllers/profiles_controller.rb
index e4865642cd3..f0c71725ea8 100644
--- a/app/controllers/profiles_controller.rb
+++ b/app/controllers/profiles_controller.rb
@@ -26,7 +26,7 @@ class ProfilesController < Profiles::ApplicationController
def reset_private_token
if current_user.reset_authentication_token!
- flash[:notice] = "Private token was successfully updated"
+ flash[:notice] = "Private token was successfully reset"
end
redirect_to profile_account_path
@@ -34,7 +34,7 @@ class ProfilesController < Profiles::ApplicationController
def reset_incoming_email_token
if current_user.reset_incoming_email_token!
- flash[:notice] = "Incoming email token was successfully updated"
+ flash[:notice] = "Incoming email token was successfully reset"
end
redirect_to profile_account_path
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 6988527a3be..4d5725448cd 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -160,6 +160,13 @@ class ProjectsController < Projects::ApplicationController
end
end
+ def new_issue_address
+ return render_404 unless Gitlab::IncomingEmail.supports_issue_creation?
+
+ current_user.reset_incoming_email_token!
+ render json: { new_issue_address: @project.new_issue_address(current_user) }
+ end
+
def archive
return access_denied! unless can?(current_user, :archive_project, @project)