Merge remote-tracking branch 'upstream/pull/3398'
This commit is contained in:
commit
1f8df781be
10 changed files with 142 additions and 5 deletions
12
app/controllers/account/deletions_controller.rb
Normal file
12
app/controllers/account/deletions_controller.rb
Normal file
|
@ -0,0 +1,12 @@
|
|||
module Account
|
||||
class DeletionsController < ApplicationController
|
||||
layout "site"
|
||||
|
||||
before_action :authorize_web
|
||||
before_action :set_locale
|
||||
|
||||
authorize_resource :class => false
|
||||
|
||||
def show; end
|
||||
end
|
||||
end
|
|
@ -51,4 +51,14 @@ class AccountsController < ApplicationController
|
|||
redirect_to auth_url(params[:user][:auth_provider], params[:user][:auth_uid]), :status => :temporary_redirect
|
||||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
current_user.soft_destroy!
|
||||
|
||||
session.delete(:user)
|
||||
session_expires_automatically
|
||||
|
||||
flash[:notice] = t ".success"
|
||||
redirect_to root_path
|
||||
end
|
||||
end
|
||||
|
|
|
@ -349,7 +349,7 @@ class ApplicationController < ActionController::Base
|
|||
elsif current_user
|
||||
set_locale
|
||||
respond_to do |format|
|
||||
format.html { redirect_to :controller => "errors", :action => "forbidden" }
|
||||
format.html { redirect_to :controller => "/errors", :action => "forbidden" }
|
||||
format.any { report_error t("application.permission_denied"), :forbidden }
|
||||
end
|
||||
elsif request.get?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue