2016-05-13 14 views
0
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 

私がログアウトすると、フラッシュメッセージ "ALARM"でサインインページにリダイレクトされます。 その後、もう一度ログインすると、「Bye!」というフラッシュメッセージでサインインページにリダイレクトされます。Session#destroy not_authenticatedアクションがトリガーされるのはなぜですか?

お願いします。

答えて

0

これは何らかの魔法のバグだった。あなたはちょうどをスキップする必要があります。destroyセッションもあとで

関連する問題