Module: SolidusJwt::Distributor::Devise

Defined in:
lib/solidus_jwt/distributor/devise.rb

Instance Method Summary collapse

Instance Method Details

#after_sign_in_path_for(resource) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/solidus_jwt/distributor/devise.rb', line 6

def (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