session-sync-auth-site 0.5.2 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +1 -1
- package/src/getLoginLink.js +2 -2
package/README.md
CHANGED
|
@@ -116,7 +116,7 @@ app.post(`get-login-link`, (req, res, next) => {
|
|
|
116
116
|
const loginLink = await getLoginLink({
|
|
117
117
|
email: req.body.email,
|
|
118
118
|
redirectUrl: req.body.redirectUrl, // must begin with the frontend domain (default: req.headers.origin)
|
|
119
|
-
origin: `https://my-backend-domain.com`, // default: req.headers.
|
|
119
|
+
origin: `https://my-backend-domain.com`, // default: `${req.protocol}://${req.headers.host}`
|
|
120
120
|
req,
|
|
121
121
|
})
|
|
122
122
|
res.send({ loginLink })
|
package/package.json
CHANGED
package/src/getLoginLink.js
CHANGED
|
@@ -4,13 +4,13 @@ const jwt = require('jsonwebtoken')
|
|
|
4
4
|
const getLoginLink = async ({
|
|
5
5
|
email,
|
|
6
6
|
redirectUrl, // defaults to req.headers.origin
|
|
7
|
-
origin, // defaults to req.headers.
|
|
7
|
+
origin, // defaults to `${req.protocol}://${req.headers.host}`
|
|
8
8
|
req, // either this or `setup` is required
|
|
9
9
|
setup, // keys: siteId, authDomain, and jwtSecret
|
|
10
10
|
}={}) => {
|
|
11
11
|
|
|
12
12
|
redirectUrl = redirectUrl || req.headers.origin
|
|
13
|
-
origin = origin || req.headers.
|
|
13
|
+
origin = origin || `${req.protocol}://${req.headers.host}`
|
|
14
14
|
|
|
15
15
|
const {
|
|
16
16
|
siteId,
|