session-sync-auth-site 0.3.1 → 0.4.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "session-sync-auth-site",
3
- "version": "0.3.1",
3
+ "version": "0.4.0",
4
4
  "main": "src/index.js",
5
5
  "repository": {
6
6
  "type": "git",
@@ -43,18 +43,18 @@
43
43
  return queryStringAddOn
44
44
  }
45
45
 
46
- const logIn = async ({ origin=defaultOrigin, extraQueryParamsForCallbacks, redirectHref }={}) => {
47
- const cancelRedirectUrl = `${redirectHref || location.href.replace(/\?.*$/, '')}?action=canceledLogin&origin=${encodeURIComponent(origin)}${getQueryStringAddOn(extraQueryParamsForCallbacks)}`
48
- const loggedInRedirectUrl = `${redirectHref || location.href.replace(/\?.*$/, '')}?action=successfulLogin&origin=${encodeURIComponent(origin)}&accessToken=ACCESS_TOKEN${getQueryStringAddOn(extraQueryParamsForCallbacks)}`
46
+ const logIn = async ({ origin=defaultOrigin, extraQueryParamsForCallbacks, loggedInRedirectHref }={}) => {
47
+ const cancelRedirectUrl = `${location.href.replace(/\?.*$/, '')}?action=canceledLogin&origin=${encodeURIComponent(origin)}${getQueryStringAddOn(extraQueryParamsForCallbacks)}`
48
+ const loggedInRedirectUrl = `${loggedInRedirectHref || location.href.replace(/\?.*$/, '')}?action=successfulLogin&origin=${encodeURIComponent(origin)}&accessToken=ACCESS_TOKEN${getQueryStringAddOn(extraQueryParamsForCallbacks)}`
49
49
 
50
50
  const queryString = `cancelRedirectUrl=${encodeURIComponent(cancelRedirectUrl)}&loggedInRedirectUrl=${encodeURIComponent(loggedInRedirectUrl)}`
51
51
 
52
52
  window.location = `${origin}/log-in?${queryString}`
53
53
  }
54
54
 
55
- const updateAccount = async ({ origin=defaultOrigin, extraQueryParamsForCallbacks, redirectHref }={}) => {
56
- const cancelRedirectUrl = `${redirectHref || location.href.replace(/\?.*$/, '')}?action=canceledAccountUpdate&origin=${encodeURIComponent(origin)}${getQueryStringAddOn(extraQueryParamsForCallbacks)}`
57
- const updatedRedirectUrl = `${redirectHref || location.href.replace(/\?.*$/, '')}?action=successfulAccountUpdate&origin=${encodeURIComponent(origin)}${getQueryStringAddOn(extraQueryParamsForCallbacks)}`
55
+ const updateAccount = async ({ origin=defaultOrigin, extraQueryParamsForCallbacks, updatedRedirectHref }={}) => {
56
+ const cancelRedirectUrl = `${location.href.replace(/\?.*$/, '')}?action=canceledAccountUpdate&origin=${encodeURIComponent(origin)}${getQueryStringAddOn(extraQueryParamsForCallbacks)}`
57
+ const updatedRedirectUrl = `${updatedRedirectHref || location.href.replace(/\?.*$/, '')}?action=successfulAccountUpdate&origin=${encodeURIComponent(origin)}${getQueryStringAddOn(extraQueryParamsForCallbacks)}`
58
58
 
59
59
  const queryString = `cancelRedirectUrl=${encodeURIComponent(cancelRedirectUrl)}&updatedRedirectUrl=${encodeURIComponent(updatedRedirectUrl)}`
60
60
 
@@ -71,7 +71,6 @@ const setUpSessionSyncAuthRoutes = ({
71
71
  userTableColNameMap,
72
72
  } = req.sessionSyncAuthSiteOptions
73
73
 
74
- mapKeys
75
74
  const jwtData = jwt.sign(
76
75
  {
77
76
  userId: req.user[userTableColNameMap.id || `id`],