Merge branch 'master' of https://github.com/tellform/tellform into publicFormImprovments
This commit is contained in:
commit
3c9c11d9db
@ -1,8 +1,8 @@
|
||||
TellForm 2.0.0
|
||||
TellForm 2.1.0
|
||||
========
|
||||
|
||||
[](https://travis-ci.org/tellform/tellform)
|
||||

|
||||

|
||||
[](https://codeclimate.com/github/whitef0x0/tellform)
|
||||
[](https://www.codacy.com/app/david-baldwin/tellform?utm_source=github.com&utm_medium=referral&utm_content=whitef0x0/tellform&utm_campaign=Badge_Grade)
|
||||
[](https://gitter.im/whitef0x0/tellform?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
||||
|
||||
@ -15,7 +15,7 @@ exports.index = function(req, res) {
|
||||
exports.form = function(req, res) {
|
||||
|
||||
//Allow form to be embedded
|
||||
res.set('X-Frame-Options', 'GOFORIT');
|
||||
res.removeHeader('X-Frame-Options');
|
||||
|
||||
res.render('form', {
|
||||
user: req.user || null,
|
||||
|
||||
@ -18,7 +18,7 @@ var smtpTransport = nodemailer.createTransport(config.mailer.options);
|
||||
/**
|
||||
* Forgot for reset password (forgot POST)
|
||||
*/
|
||||
exports.forgot = function(req, res, next) {
|
||||
exports.forgot = function(req, res) {
|
||||
async.waterfall([
|
||||
// Generate random token
|
||||
function(done) {
|
||||
@ -81,22 +81,33 @@ exports.forgot = function(req, res, next) {
|
||||
subject: 'Password Reset',
|
||||
html: emailHTML
|
||||
};
|
||||
smtpTransport.sendMail(mailOptions, function(err) {
|
||||
if (!err) {
|
||||
res.send({
|
||||
message: 'An email has been sent to ' + user.email + ' with further instructions.'
|
||||
});
|
||||
} else {
|
||||
return res.status(400).send({
|
||||
message: 'Failure sending email'
|
||||
});
|
||||
}
|
||||
|
||||
done(err);
|
||||
var userEmail = user.email;
|
||||
var user = userEmail.split('@')[0];
|
||||
var domain = userEmail.split('@')[1];
|
||||
|
||||
var obfuscatedUser = user.substring(0, 1) + user.substring(1).replace(/./g, '*');
|
||||
var domainName = domain.split('.')[0];
|
||||
var tld = domain.split('.')[1];
|
||||
|
||||
var obfuscatedDomainName = domainName.replace(/./g, '*');
|
||||
var obfuscatedEmail = obfuscatedUser + '@' + obfuscatedDomainName + '.' + tld;
|
||||
|
||||
smtpTransport.sendMail(mailOptions, function(err) {
|
||||
done(err, obfuscatedEmail);
|
||||
});
|
||||
}
|
||||
], function(err, obfuscatedEmail) {
|
||||
if (err) {
|
||||
console.log(err);
|
||||
return res.status(400).send({
|
||||
message: 'Couldn\'t send reset password email due to internal server errors. Please contact support at team@tellform.com.'
|
||||
});
|
||||
} else {
|
||||
return res.send({
|
||||
message: 'An email has been sent to ' + obfuscatedEmail + ' with further instructions.'
|
||||
});
|
||||
}
|
||||
], function(err) {
|
||||
if (err) return next(err);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@ -34,34 +34,7 @@ module.exports = function(app) {
|
||||
app.route('/auth/signout').get(users.signout);
|
||||
|
||||
app.route('/auth/genkey').get(users.requiresLogin, users.generateAPIKey);
|
||||
|
||||
// // Setting the facebook oauth routes
|
||||
// app.route('/auth/facebook').get(passport.authenticate('facebook', {
|
||||
// scope: ['email']
|
||||
// }));
|
||||
// app.route('/auth/facebook/callback').get(users.oauthCallback('facebook'));
|
||||
|
||||
// // Setting the twitter oauth routes
|
||||
// app.route('/auth/twitter').get(passport.authenticate('twitter'));
|
||||
// app.route('/auth/twitter/callback').get(users.oauthCallback('twitter'));
|
||||
|
||||
// // Setting the google oauth routes
|
||||
// app.route('/auth/google').get(passport.authenticate('google', {
|
||||
// scope: [
|
||||
// 'https://www.googleapis.com/auth/userinfo.profile',
|
||||
// 'https://www.googleapis.com/auth/userinfo.email'
|
||||
// ]
|
||||
// }));
|
||||
// app.route('/auth/google/callback').get(users.oauthCallback('google'));
|
||||
|
||||
// // Setting the linkedin oauth routes
|
||||
// app.route('/auth/linkedin').get(passport.authenticate('linkedin'));
|
||||
// app.route('/auth/linkedin/callback').get(users.oauthCallback('linkedin'));
|
||||
|
||||
// // Setting the github oauth routes
|
||||
// app.route('/auth/github').get(passport.authenticate('github'));
|
||||
// app.route('/auth/github/callback').get(users.oauthCallback('github'));
|
||||
|
||||
|
||||
// Finish by binding the user middleware
|
||||
app.param('userId', users.userByID);
|
||||
};
|
||||
|
||||
@ -38,6 +38,11 @@ module.exports = function (io, socket) {
|
||||
city: geoData.city,
|
||||
country: geoData.country_name
|
||||
}
|
||||
form.save(function (formSaveErr) {
|
||||
if (err) {
|
||||
console.error(err);
|
||||
throw new Error(errorHandler.getErrorMessage(formSaveErr));
|
||||
}
|
||||
|
||||
form.form_fields = form.form_fields.map(v => Object.assign({}, v, { fieldValue: null }));
|
||||
|
||||
@ -85,3 +90,4 @@ module.exports = function (io, socket) {
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "TellForm",
|
||||
"description": "Opensource alternative to TypeForm",
|
||||
"version": "2.0.0",
|
||||
"version": "2.1.0",
|
||||
"homepage": "https://github.com/whitef0x0/tellform",
|
||||
"authors": [
|
||||
"David Baldwynn <polydaic@gmail.com> (http://baldwynn.me)"
|
||||
|
||||
347
public/dist/application.js
vendored
347
public/dist/application.js
vendored
File diff suppressed because one or more lines are too long
2
public/dist/application.min.css
vendored
2
public/dist/application.min.css
vendored
File diff suppressed because one or more lines are too long
10
public/dist/application.min.js
vendored
10
public/dist/application.min.js
vendored
File diff suppressed because one or more lines are too long
280
public/dist/form-application.js
vendored
280
public/dist/form-application.js
vendored
File diff suppressed because one or more lines are too long
4
public/dist/form-application.min.js
vendored
4
public/dist/form-application.min.js
vendored
File diff suppressed because one or more lines are too long
16
public/dist/vendor.min.js
vendored
16
public/dist/vendor.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,3 +1,8 @@
|
||||
|
||||
form .btn {
|
||||
border-color: grey;
|
||||
}
|
||||
|
||||
.public-form.preview {
|
||||
border: none;
|
||||
box-shadow: 0px 0px 10px 0px grey;
|
||||
|
||||
@ -13,10 +13,10 @@
|
||||
<div class="text-center form-group">
|
||||
<button type="submit" class="btn btn-signup btn-rounded btn-block">{{ 'PASSWORD_RESTORE_HEADER' | translate }}</button>
|
||||
</div>
|
||||
<div data-ng-show="error" class="text-center text-danger">
|
||||
<strong>{{error}}</strong>
|
||||
<div data-ng-show="error" class="text-center">
|
||||
<strong>Error: {{error}}</strong>
|
||||
</div>
|
||||
<div data-ng-show="success" class="text-center text-success">
|
||||
<div data-ng-show="success" class="text-center">
|
||||
<strong>{{success}}</strong>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user