diff options
author | Douwe Maan <douwe@gitlab.com> | 2016-11-08 10:47:45 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2016-11-08 10:47:45 +0000 |
commit | 9c3f3e9e359740b10edafaa1b06b0ff3e2070820 (patch) | |
tree | 01846d1a63bd1177b68377822fcb23b86e176cf2 /app/controllers | |
parent | 8f85bd5789d50c080a7214981cc0a45fcb382bef (diff) | |
parent | 011e561bfa227f3ecbafe5b1ffd51700c680a15f (diff) | |
download | gitlab-ce-9c3f3e9e359740b10edafaa1b06b0ff3e2070820.tar.gz |
Merge branch 'use-separate-token-for-incoming-email' into 'master'
Use separate email-friendly token for incoming email
See merge request !5914
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/profiles_controller.rb | 10 | ||||
-rw-r--r-- | app/controllers/projects_controller.rb | 7 |
2 files changed, 16 insertions, 1 deletions
diff --git a/app/controllers/profiles_controller.rb b/app/controllers/profiles_controller.rb index f71e0a1302b..f0c71725ea8 100644 --- a/app/controllers/profiles_controller.rb +++ b/app/controllers/profiles_controller.rb @@ -26,7 +26,15 @@ class ProfilesController < Profiles::ApplicationController def reset_private_token if current_user.reset_authentication_token! - flash[:notice] = "Token was successfully updated" + flash[:notice] = "Private token was successfully reset" + end + + redirect_to profile_account_path + end + + def reset_incoming_email_token + if current_user.reset_incoming_email_token! + 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 8cd50480ec1..28820adcc46 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) |