Redirect to "/users/sign_in" after AccountDeletion

There is no point to redirect to "/stream" after the account deletion
because the user is logged off.
This commit is contained in:
cmrd Senya 2016-04-06 16:19:01 +03:00
parent a414fb2381
commit 77bd220e24
No known key found for this signature in database
GPG key ID: 5FCC5BA680E67BFE

View file

@ -95,7 +95,7 @@ class UsersController < ApplicationController
if params[:user] && params[:user][:current_password] && current_user.valid_password?(params[:user][:current_password])
current_user.close_account!
sign_out current_user
redirect_to(stream_path, :notice => I18n.t('users.destroy.success'))
redirect_to(new_user_session_path(format: request[:format]), notice: I18n.t("users.destroy.success"))
else
if params[:user].present? && params[:user][:current_password].present?
flash[:error] = t 'users.destroy.wrong_password'