@things-factory/auth-base 7.0.14 → 7.0.22

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": "@things-factory/auth-base",
3
- "version": "7.0.14",
3
+ "version": "7.0.22",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "dist-client/index.js",
6
6
  "things-factory": true,
@@ -32,9 +32,9 @@
32
32
  "dependencies": {
33
33
  "@simplewebauthn/browser": "^10.0.0",
34
34
  "@simplewebauthn/server": "^10.0.0",
35
- "@things-factory/email-base": "^7.0.14",
35
+ "@things-factory/email-base": "^7.0.19",
36
36
  "@things-factory/env": "^7.0.14",
37
- "@things-factory/shell": "^7.0.14",
37
+ "@things-factory/shell": "^7.0.19",
38
38
  "@things-factory/utils": "^7.0.14",
39
39
  "@types/webappsec-credential-management": "^0.6.8",
40
40
  "jsonwebtoken": "^9.0.0",
@@ -46,5 +46,5 @@
46
46
  "passport-jwt": "^4.0.0",
47
47
  "passport-local": "^1.0.0"
48
48
  },
49
- "gitHead": "f035fb9205690ef854626872fcdfc85608d84dc2"
49
+ "gitHead": "2482cabd0a609346f2dfb1c89316b72468dd33bf"
50
50
  }
@@ -94,8 +94,12 @@ async function checkIn(
94
94
  redirectTo: string | null,
95
95
  context: ResolverContext
96
96
  ): Promise<void> {
97
- const user: User = context.state.user
98
- await LoginHistory.stamp(checkInDomain, user, context.req.connection.remoteAddress)
97
+ const { user }: { user: User } = context.state
98
+ const remoteAddress = context.req.headers['x-forwarded-for']
99
+ ? (context.req.headers['x-forwarded-for'] as string).split(',')[0].trim()
100
+ : context.req.connection.remoteAddress
101
+
102
+ await LoginHistory.stamp(checkInDomain, user, remoteAddress)
99
103
 
100
104
  if (redirectTo) {
101
105
  return context.redirect(getRedirectSubdomainPath(context, checkInDomain.subdomain, redirectTo))