Sha256: f54c84a00b82b81ea19f7e4cd141c5b76d5b321247cb291e78cfaa4667e4f8af

Contents?: true

Size: 731 Bytes

Versions: 1

Compression:

Stored size: 731 Bytes

Contents

# frozen_string_literal: true

module Macros
  class Auth
    # Expire session data
    # Macro is used in other Devise' related macros because of the bug
    # https://github.com/plataformatec/devise/blob/master/lib/devise/controllers/sign_in_out.rb#L108
    #
    # @example
    #   step Macros::Auth::ExpireSessionData()
    #
    class ExpireSessionData < Macros::Base
      # @return [Macros::Auth::ExpireSessionData] step macro instance
      def initialize; end

      # @param ctx [Trailblazer::Skill] tbl context hash
      def call(ctx, **)
        session = ctx[:warden].session_serializer.session

        session.empty?
        session.keys.grep(/^devise\./).each { |k| session.delete(k) }
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ff-tbl-macros-2.0.2 lib/macros/auth/expire_session_data.rb