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
2222NEXT_PUBLIC_SPREE_IMAGES_OPTION_FILTER = false
2323NEXT_PUBLIC_SPREE_IMAGES_SIZE = 1000x1000
2424NEXT_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'
1010import useCart from '../cart/use-cart'
1111import useWishlist from '../wishlist/use-wishlist'
1212import login from '../utils/login'
13+ import { requireConfigValue } from '@framework/isomorphic-config'
1314
1415export default useSignup as UseSignup < typeof handler >
1516
@@ -62,7 +63,9 @@ export const handler: MutationHook<SignupHook> = {
6263 }
6364
6465 // Login immediately after the account is created.
65- await login ( fetch , getTokenParameters , true )
66+ if ( requireConfigValue ( 'loginAfterSignup' ) ) {
67+ await login ( fetch , getTokenParameters , true )
68+ }
6669
6770 return null
6871 } ,
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ const isomorphicConfig = {
4545 imagesQuality : validateImagesQuality (
4646 process . env . NEXT_PUBLIC_SPREE_IMAGES_QUALITY
4747 ) ,
48+ loginAfterSignup : process . env . NEXT_PUBLIC_SPREE_LOGIN_AFTER_SIGNUP === 'true' ,
4849}
4950
5051export default forceIsomorphicConfigValues (
@@ -68,6 +69,7 @@ export default forceIsomorphicConfigValues(
6869 'imagesOptionFilter' ,
6970 'imagesSize' ,
7071 'imagesQuality' ,
72+ 'loginAfterSignup' ,
7173 ]
7274)
7375
Original file line number Diff line number Diff line change @@ -14,11 +14,7 @@ const createEmptyCart = (
1414 return fetch < GraphQLFetcherResult < IOrder > > ( {
1515 variables : {
1616 methodPath : 'cart.create' ,
17- arguments : [
18- {
19- token,
20- } ,
21- ] ,
17+ arguments : [ token ] ,
2218 } ,
2319 } )
2420}
You can’t perform that action at this time.
0 commit comments