Sha256: 8708f054de07049b9ca8160662dd40e09c6db13353ce91cbeaa7049201b4a8f6

Contents?: true

Size: 456 Bytes

Versions: 3

Compression:

Stored size: 456 Bytes

Contents

# frozen_string_literal: true

module SolidusJwt
  module Distributor
    module Devise
      def after_sign_in_path_for(resource)
        # Send back json web token in redirect header
        if try_spree_current_user
          response.headers['X-SPREE-TOKEN'] = try_spree_current_user.
                                              generate_jwt_token(expires_in: SolidusJwt::Config.jwt_expiration)
        end

        super
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
solidus_jwt-1.2.2 lib/solidus_jwt/distributor/devise.rb
solidus_jwt-1.2.1 lib/solidus_jwt/distributor/devise.rb
solidus_jwt-1.2.0 lib/solidus_jwt/distributor/devise.rb