Skip to content

Commit

Permalink
Merge branch 'master' into fix_order_shipping_address
Browse files Browse the repository at this point in the history
  • Loading branch information
jayelkaake authored Jun 16, 2021
2 parents 3d1ea7a + d59d0da commit da25b8e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
8 changes: 3 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
language: ruby
rvm:
- ruby-head
- 2.0
- 2.1
- 2.2
- 2.3
- 2.4
- 2.6
- 2.7
- 3.0
cache:
bundler: true
sudo: false
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved
Copyright (c) 2019-present, BigCommerce Pty. Ltd. All rights reserved

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
Expand Down
7 changes: 4 additions & 3 deletions lib/bigcommerce/resources/customers/customer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,18 @@ def self.count(params = {})
# Generate a token that can be used to log the customer into the storefront.
# This requires your app to have the store_v2_customers_login scope and to
# be installed in the store.
def login_token(config: Bigcommerce.config)
def login_token(config: Bigcommerce.config, redirect_to: '/')
payload = {
'iss' => config.client_id,
'iat' => Time.now.to_i,
'jti' => SecureRandom.uuid,
'operation' => 'customer_login',
'store_hash' => config.store_hash,
'customer_id' => id
'customer_id' => id,
'redirect_to' => redirect_to
}

JWT.encode(payload, config.client_secret, 'HS256')
JWT.encode(payload, config.client_secret, 'HS256', { typ: 'JWT' })
end
end
end

0 comments on commit da25b8e

Please sign in to comment.