app/controllers/sessions_controller.rb in tkh_authentication-0.0.5 vs app/controllers/sessions_controller.rb in tkh_authentication-0.0.6
- old
+ new
@@ -9,10 +9,11 @@
if params[:remember_me]
cookies.permanent[:auth_token] = user.auth_token
else
cookies[:auth_token] = user.auth_token
end
- redirect_to root_url, notice: t('authentication.login_confirmation')
+ redirect_to (session[:target_page] || root_url), notice: t('authentication.login_confirmation')
+ session[:target_page] = nil
else
flash.now.alert = t('authentication.warning.email_or_password_invalid')
render "new"
end
end