Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why does Session#Destroy trigger not_authenticated action? #776

Open
slava-nikulin opened this issue May 11, 2016 · 0 comments
Open

Why does Session#Destroy trigger not_authenticated action? #776

slava-nikulin opened this issue May 11, 2016 · 0 comments

Comments

@slava-nikulin
Copy link

slava-nikulin commented May 11, 2016

class UserSessionsController < ApplicationController
  skip_before_action :require_login, except: [:destroy]

  def new
    ...
  end

  def create
    ...
  end

  def destroy
    logout
    redirect_to signin_path , flash: { info: 'Bye!' }
  end
end

class ApplicationController < ActionController::Base
  before_action :require_login

  private
  def not_authenticated
    redirect_to signin_path, flash: { danger: "ALARM!" }
  end
end

After I logout, I'm redirected to sign in page with flash message "ALARM".
After that, when I log in again I'm redirected to sign in page with flash message "Bye!"
Please, help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant