Skip to content
This repository was archived by the owner on Oct 19, 2020. It is now read-only.

Commit b6892fd

Browse files
fix broken signup
1 parent 3d71ed1 commit b6892fd

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/utils/auth/sign-up.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@ import log from 'js-logger'
99
* @param {object} args
1010
* @param {string} args.email
1111
* @param {string} args.password (optional)
12+
* @param {string} args.emailOptIn (optional)
1213
*/
1314
export default function signUp (args) {
1415

1516
var credentials = {
1617
email: args.email,
1718
password: args.password || uuid.generate(),
18-
accountSetup: '3dio'
19+
accountSetup: '3dio',
20+
emailOptIn: args.emailOptIn || false
1921
}
2022

2123
// log out first

src/utils/ui/create-sign-up-ui.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ export default function createSignUpUi (credentials, options) {
7979

8080
el('<p>', { text:'email:', class:'hint' }).appendTo(emailTabEl)
8181
var emailEl = el('<input>',{ type: 'text' }).appendTo(emailTabEl)
82+
var checkboxEl = el('<div>', {style: 'margin-top: 20px;' }).appendTo(emailTabEl)
83+
el('<label>',{ text: 'Keep me up to date about 3d.io' }).appendTo(checkboxEl)
84+
var emailOptInEl = el('<input>',{ type: 'checkbox', style: 'margin-left: 20px;', id: 'email-opt-in'}).appendTo(checkboxEl)
8285
if (email) emailEl.val(email)
8386
emailEl.focus()
8487
function onEmailElKeyDown (e) {
@@ -145,7 +148,7 @@ export default function createSignUpUi (credentials, options) {
145148
return resendActivationEmail({ email: emailEl.val() })
146149
} else {
147150
// sign up
148-
return signUp({ email: emailEl.val() })
151+
return signUp({ email: emailEl.val(), emailOptIn: emailOptInEl.checked })
149152
}
150153
})
151154
.then(function(){

0 commit comments

Comments
 (0)