This repository was archived by the owner on Mar 13, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +8
-6
lines changed Expand file tree Collapse file tree 4 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -22,3 +22,4 @@ NEXT_PUBLIC_SPREE_LINE_ITEM_PLACEHOLDER_IMAGE_URL=/product-img-placeholder.svg
22
22
NEXT_PUBLIC_SPREE_IMAGES_OPTION_FILTER = false
23
23
NEXT_PUBLIC_SPREE_IMAGES_SIZE = 1000x1000
24
24
NEXT_PUBLIC_SPREE_IMAGES_QUALITY = 100
25
+ NEXT_PUBLIC_SPREE_LOGIN_AFTER_SIGNUP = true
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import useCustomer from '../customer/use-customer'
10
10
import useCart from '../cart/use-cart'
11
11
import useWishlist from '../wishlist/use-wishlist'
12
12
import login from '../utils/login'
13
+ import { requireConfigValue } from '@framework/isomorphic-config'
13
14
14
15
export default useSignup as UseSignup < typeof handler >
15
16
@@ -62,7 +63,9 @@ export const handler: MutationHook<SignupHook> = {
62
63
}
63
64
64
65
// Login immediately after the account is created.
65
- await login ( fetch , getTokenParameters , true )
66
+ if ( requireConfigValue ( 'loginAfterSignup' ) ) {
67
+ await login ( fetch , getTokenParameters , true )
68
+ }
66
69
67
70
return null
68
71
} ,
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ const isomorphicConfig = {
45
45
imagesQuality : validateImagesQuality (
46
46
process . env . NEXT_PUBLIC_SPREE_IMAGES_QUALITY
47
47
) ,
48
+ loginAfterSignup : process . env . NEXT_PUBLIC_SPREE_LOGIN_AFTER_SIGNUP === 'true' ,
48
49
}
49
50
50
51
export default forceIsomorphicConfigValues (
@@ -68,6 +69,7 @@ export default forceIsomorphicConfigValues(
68
69
'imagesOptionFilter' ,
69
70
'imagesSize' ,
70
71
'imagesQuality' ,
72
+ 'loginAfterSignup' ,
71
73
]
72
74
)
73
75
Original file line number Diff line number Diff line change @@ -14,11 +14,7 @@ const createEmptyCart = (
14
14
return fetch < GraphQLFetcherResult < IOrder > > ( {
15
15
variables : {
16
16
methodPath : 'cart.create' ,
17
- arguments : [
18
- {
19
- token,
20
- } ,
21
- ] ,
17
+ arguments : [ token ] ,
22
18
} ,
23
19
} )
24
20
}
You can’t perform that action at this time.
0 commit comments