added protocol check

This commit is contained in:
Khue Nguyen
2018-02-04 17:22:20 -08:00
parent 1450649439
commit dca5d4b757

View File

@@ -263,7 +263,8 @@ module.exports = (nextApp, {
}
const token = uuid()
const url = (serverUrl || `http://${req.headers.host}`) + `${pathPrefix}/email/signin/${token}`
const http = req.secure ? 'https' : 'http'
const url = (serverUrl || `${http}://${req.headers.host}`) + `${pathPrefix}/email/signin/${token}`
// Create verification token save it to database
functions.find({ email: email })