Skip to content

Commit

Permalink
fix(tps): missing host name in some cases
Browse files Browse the repository at this point in the history
  • Loading branch information
polonel committed Mar 20, 2019
1 parent 893af61 commit c3704b5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/emitter/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ var notifications = require('../notifications') // Load Push Events
tpsEnabled: tpsEnabled,
tpsUsername: tpsUsername,
tpsApiKey: tpsApiKey,
hostname: hostname
hostname: hostname || baseUrl
},
{ type: 1, ticket: ticketPushClone }
)
Expand All @@ -187,7 +187,7 @@ var notifications = require('../notifications') // Load Push Events
tpsEnabled: tpsEnabled,
tpsUsername: tpsUsername,
tpsApiKey: tpsApiKey,
hostname: hostname
hostname: hostname || baseUrl
},
{ type: 1, ticket: ticket }
)
Expand Down
6 changes: 4 additions & 2 deletions src/models/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -522,11 +522,13 @@ userSchema.statics.createUserFromEmail = function (email, callback) {
if (_.isUndefined(email)) {
return callback('Invalid User Data - UserSchema.CreatePublicUser()', null)
}

var self = this

var settingSchema = require('./setting')
settingSchema.getSetting('role:user:default', function (err, userRoleDefault) {
if (err || !userRoleDefault) return callback('Invalid Setting - UserRoleDefault')

var self = this
var Chance = require('chance')

var chance = new Chance()
Expand All @@ -536,7 +538,7 @@ userSchema.statics.createUserFromEmail = function (email, callback) {
pool: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890'
})

var user = new this({
var user = new self({
username: email,
email: email,
password: plainTextPass,
Expand Down

0 comments on commit c3704b5

Please sign in to comment.