File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
lib/bigcommerce/resources/customers Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -34,17 +34,18 @@ def self.count(params = {})
34
34
# Generate a token that can be used to log the customer into the storefront.
35
35
# This requires your app to have the store_v2_customers_login scope and to
36
36
# be installed in the store.
37
- def login_token ( config : Bigcommerce . config )
37
+ def login_token ( config : Bigcommerce . config , redirect_to : '/' )
38
38
payload = {
39
39
'iss' => config . client_id ,
40
40
'iat' => Time . now . to_i ,
41
41
'jti' => SecureRandom . uuid ,
42
42
'operation' => 'customer_login' ,
43
43
'store_hash' => config . store_hash ,
44
- 'customer_id' => id
44
+ 'customer_id' => id ,
45
+ 'redirect_to' => redirect_to
45
46
}
46
47
47
- JWT . encode ( payload , config . client_secret , 'HS256' )
48
+ JWT . encode ( payload , config . client_secret , 'HS256' , { typ : 'JWT' } )
48
49
end
49
50
end
50
51
end
You can’t perform that action at this time.
0 commit comments