Skip to content

Commit f1fe696

Browse files
committed
Add redirect_to to Customer#login_token payload
1 parent a8b9550 commit f1fe696

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/bigcommerce/resources/customers/customer.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,15 @@ def self.count(params = {})
3434
# Generate a token that can be used to log the customer into the storefront.
3535
# This requires your app to have the store_v2_customers_login scope and to
3636
# be installed in the store.
37-
def login_token(config: Bigcommerce.config)
37+
def login_token(config: Bigcommerce.config, redirect_to: '/')
3838
payload = {
3939
'iss' => config.client_id,
4040
'iat' => Time.now.to_i,
4141
'jti' => SecureRandom.uuid,
4242
'operation' => 'customer_login',
4343
'store_hash' => config.store_hash,
44-
'customer_id' => id
44+
'customer_id' => id,
45+
'redirect_to' => redirect_to
4546
}
4647

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

0 commit comments

Comments
 (0)