Skip to content

Commit 5048c02

Browse files
committed
Enable passwordless and social login
1 parent 3c60cb7 commit 5048c02

File tree

3 files changed

+30
-7
lines changed

3 files changed

+30
-7
lines changed

packages/pwa-kit-create-app/assets/bootstrap/js/config/default.js.hbs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ module.exports = {
2020
login: {
2121
passwordless: {
2222
// Enables or disables passwordless login for the site. Defaults to: false
23+
{{~#if answers.project.demo.enablePasswordlessAndSocialLogin}}
24+
enabled: true,
25+
{{else}}
2326
enabled: false,
27+
{{/if}}
2428
// The callback URI, which can be an absolute URL (including third-party URIs) or a relative path set up by the developer.
2529
// Required in 'callback' mode; if missing, passwordless login defaults to 'sms' mode, which requires Marketing Cloud configuration.
2630
// If the env var `PASSWORDLESS_LOGIN_CALLBACK_URI` is set, it will override the config value.
@@ -31,7 +35,11 @@ module.exports = {
3135
},
3236
social: {
3337
// Enables or disables social login for the site. Defaults to: false
38+
{{~#if answers.project.demo.enablePasswordlessAndSocialLogin}}
39+
enabled: true,
40+
{{else}}
3441
enabled: false,
42+
{{/if}}
3543
// The third-party identity providers supported by your app. The PWA Kit supports Google and Apple by default.
3644
// Additional IDPs will also need to be added to the IDP_CONFIG in the SocialLogin component.
3745
idps: ['google', 'apple'],

packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/default.js.hbs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ module.exports = {
2222
login: {
2323
passwordless: {
2424
// Enables or disables passwordless login for the site. Defaults to: false
25+
{{~#if answers.project.demo.enablePasswordlessAndSocialLogin}}
26+
enabled: true,
27+
{{else}}
2528
enabled: false,
29+
{{/if}}
2630
// The callback URI, which can be an absolute URL (including third-party URIs) or a relative path set up by the developer.
2731
// Required in 'callback' mode; if missing, passwordless login defaults to 'sms' mode, which requires Marketing Cloud configuration.
2832
// If the env var `PASSWORDLESS_LOGIN_CALLBACK_URI` is set, it will override the config value.
@@ -33,7 +37,11 @@ module.exports = {
3337
},
3438
social: {
3539
// Enables or disables social login for the site. Defaults to: false
40+
{{~#if answers.project.demo.enablePasswordlessAndSocialLogin}}
41+
enabled: true,
42+
{{else}}
3643
enabled: false,
44+
{{/if}}
3745
// The third-party identity providers supported by your app. The PWA Kit supports Google and Apple by default.
3846
// Additional IDPs will also need to be added to the IDP_CONFIG in the SocialLogin component.
3947
idps: ['google', 'apple'],

packages/pwa-kit-create-app/scripts/create-mobify-app.js

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,8 @@ const PRESETS = [
269269
['project.commerce.shortCode']: 'kv7kzm78',
270270
['project.commerce.isSlasPrivate']: false,
271271
['project.einstein.clientId']: '1ea06c6e-c936-4324-bcf0-fada93f83bb1',
272-
['project.einstein.siteId']: 'aaij-MobileFirst'
272+
['project.einstein.siteId']: 'aaij-MobileFirst',
273+
['project.demo.enablePasswordlessAndSocialLogin']: false
273274
},
274275
assets: ['translations'],
275276
private: false
@@ -300,7 +301,8 @@ const PRESETS = [
300301
['project.commerce.shortCode']: 'kv7kzm78',
301302
['project.commerce.isSlasPrivate']: true,
302303
['project.einstein.clientId']: '1ea06c6e-c936-4324-bcf0-fada93f83bb1',
303-
['project.einstein.siteId']: 'aaij-MobileFirst'
304+
['project.einstein.siteId']: 'aaij-MobileFirst',
305+
['project.demo.enablePasswordlessAndSocialLogin']: true // True only for PWA Kit demo environments!
304306
},
305307
assets: ['translations'],
306308
private: true
@@ -325,7 +327,8 @@ const PRESETS = [
325327
['project.commerce.shortCode']: 'kv7kzm78',
326328
['project.commerce.isSlasPrivate']: false,
327329
['project.einstein.clientId']: '1ea06c6e-c936-4324-bcf0-fada93f83bb1',
328-
['project.einstein.siteId']: 'aaij-MobileFirst'
330+
['project.einstein.siteId']: 'aaij-MobileFirst',
331+
['project.demo.enablePasswordlessAndSocialLogin']: false
329332
},
330333
assets: ['translations'],
331334
private: true
@@ -350,7 +353,8 @@ const PRESETS = [
350353
['project.commerce.shortCode']: 'kv7kzm78',
351354
['project.commerce.isSlasPrivate']: true,
352355
['project.einstein.clientId']: '1ea06c6e-c936-4324-bcf0-fada93f83bb1',
353-
['project.einstein.siteId']: 'aaij-MobileFirst'
356+
['project.einstein.siteId']: 'aaij-MobileFirst',
357+
['project.demo.enablePasswordlessAndSocialLogin']: false
354358
},
355359
assets: ['translations'],
356360
private: true
@@ -375,7 +379,8 @@ const PRESETS = [
375379
['project.commerce.shortCode']: 'staging-001',
376380
['project.einstein.clientId']: '1ea06c6e-c936-4324-bcf0-fada93f83bb1',
377381
['project.einstein.siteId']: 'aaij-MobileFirst',
378-
['project.commerce.isSlasPrivate']: true
382+
['project.commerce.isSlasPrivate']: true,
383+
['project.demo.enablePasswordlessAndSocialLogin']: false
379384
},
380385
assets: ['translations'],
381386
private: true
@@ -400,7 +405,8 @@ const PRESETS = [
400405
['project.commerce.shortCode']: 'xitgmcd3',
401406
['project.einstein.clientId']: '1ea06c6e-c936-4324-bcf0-fada93f83bb1',
402407
['project.einstein.siteId']: 'aaij-MobileFirst',
403-
['project.commerce.isSlasPrivate']: true
408+
['project.commerce.isSlasPrivate']: true,
409+
['project.demo.enablePasswordlessAndSocialLogin']: false
404410
},
405411
assets: ['translations'],
406412
private: true
@@ -425,7 +431,8 @@ const PRESETS = [
425431
['project.commerce.shortCode']: 'performance-001',
426432
['project.einstein.clientId']: '1ea06c6e-c936-4324-bcf0-fada93f83bb1',
427433
['project.einstein.siteId']: 'aaij-MobileFirst',
428-
['project.commerce.isSlasPrivate']: false
434+
['project.commerce.isSlasPrivate']: false,
435+
['project.demo.enablePasswordlessAndSocialLogin']: false
429436
},
430437
assets: ['translations'],
431438
private: true

0 commit comments

Comments
 (0)