about summary refs log tree commit diff
path: root/app/controllers/settings
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2020-05-13 23:46:09 +0200
committerGitHub <noreply@github.com>2020-05-13 23:46:09 +0200
commite1d282023432ff4a88cb795f3a9889704314e448 (patch)
tree89f9525142d0bf876a4fb6e0117163c0a76bb78a /app/controllers/settings
parentc6ff4c634caf718adf7280e04909c091d15add1d (diff)
parentd147dd7588502f22ac825780bb1d6e54eb3613e6 (diff)
Merge pull request #1327 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/controllers/settings')
-rw-r--r--app/controllers/settings/identity_proofs_controller.rb12
1 files changed, 8 insertions, 4 deletions
diff --git a/app/controllers/settings/identity_proofs_controller.rb b/app/controllers/settings/identity_proofs_controller.rb
index e84c1aca6..b217b3c3b 100644
--- a/app/controllers/settings/identity_proofs_controller.rb
+++ b/app/controllers/settings/identity_proofs_controller.rb
@@ -22,8 +22,7 @@ class Settings::IdentityProofsController < Settings::BaseController
     if current_account.username.casecmp(params[:username]).zero?
       render layout: 'auth'
     else
-      flash[:alert] = I18n.t('identity_proofs.errors.wrong_user', proving: params[:username], current: current_account.username)
-      redirect_to settings_identity_proofs_path
+      redirect_to settings_identity_proofs_path, alert: I18n.t('identity_proofs.errors.wrong_user', proving: params[:username], current: current_account.username)
     end
   end
 
@@ -35,11 +34,16 @@ class Settings::IdentityProofsController < Settings::BaseController
       PostStatusService.new.call(current_user.account, text: post_params[:status_text]) if publish_proof?
       redirect_to @proof.on_success_path(params[:user_agent])
     else
-      flash[:alert] = I18n.t('identity_proofs.errors.failed', provider: @proof.provider.capitalize)
-      redirect_to settings_identity_proofs_path
+      redirect_to settings_identity_proofs_path, alert: I18n.t('identity_proofs.errors.failed', provider: @proof.provider.capitalize)
     end
   end
 
+  def destroy
+    @proof = current_account.identity_proofs.find(params[:id])
+    @proof.destroy!
+    redirect_to settings_identity_proofs_path, success: I18n.t('identity_proofs.removed')
+  end
+
   private
 
   def check_enabled