@things-factory/auth-base 7.0.1-beta.7 → 7.0.1-beta.9

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.1-beta.7",
3
+ "version": "7.0.1-beta.9",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "dist-client/index.js",
6
6
  "things-factory": true,
@@ -30,9 +30,9 @@
30
30
  "migration:create": "node ../../node_modules/typeorm/cli.js migration:create -d ./server/migrations"
31
31
  },
32
32
  "dependencies": {
33
- "@things-factory/email-base": "^7.0.1-beta.7",
33
+ "@things-factory/email-base": "^7.0.1-beta.8",
34
34
  "@things-factory/env": "^7.0.1-beta.6",
35
- "@things-factory/shell": "^7.0.1-beta.7",
35
+ "@things-factory/shell": "^7.0.1-beta.8",
36
36
  "@things-factory/utils": "^7.0.1-beta.6",
37
37
  "@types/webappsec-credential-management": "^0.6.8",
38
38
  "jsonwebtoken": "^9.0.0",
@@ -45,5 +45,5 @@
45
45
  "passport-local": "^1.0.0",
46
46
  "popsicle-cookie-jar": "^1.0.0"
47
47
  },
48
- "gitHead": "aedcdffb709f76c636e0693177a4a1d6984cb0de"
48
+ "gitHead": "b2fb4923e2763b4d831f934905dd6ae0019446a4"
49
49
  }
@@ -17,3 +17,4 @@ export const PASSWORD_USED_PAST = 'password used in the past'
17
17
  export const VERIFICATION_ERROR = 'user or verification token not found'
18
18
  export const USER_CREDENTIAL_NOT_FOUND = 'user credential not found'
19
19
  export const AUTH_ERROR = 'auth error'
20
+ export const FIDO2_CERT_UNSUPPORTED = 'fido2 certificate unsupported'
@@ -24,7 +24,12 @@ passport.use(
24
24
  return cb(null, false, { errorCode: AuthError.ERROR_CODES.USER_CREDENTIAL_NOT_FOUND })
25
25
  }
26
26
 
27
- return cb(null, user, credential.publicKey)
27
+ try {
28
+ return cb(null, user, credential.publicKey)
29
+ } catch (error) {
30
+ console.error(error)
31
+ return cb(null, false, { errorCode: AuthError.ERROR_CODES.FIDO2_CERT_UNSUPPORTED })
32
+ }
28
33
  },
29
34
  async function register(user, id, publicKey, cb) {
30
35
  const userObject = await getRepository(User).findOne({ where: { id: user.id.toString() } })
@@ -4,6 +4,7 @@
4
4
  "error.domain mismatch": "certificate is not for this domain",
5
5
  "error.domain not allowed": "user not allowed domain `{subdomain}`",
6
6
  "error.failed to find x": "failed to find {x}",
7
+ "error.fido2 certificate unsupported": "FIDO2 certificate unsupported",
7
8
  "error.password should match the rule": "password should match following rule. ${rule}",
8
9
  "error.password used in the past": "password used in the past",
9
10
  "error.subdomain not found": "domain not found",
@@ -4,6 +4,7 @@
4
4
  "error.domain mismatch": "証明書のドメインと現在のドメインが一致しません.",
5
5
  "error.domain not allowed": "'{subdomain}' 領域はこのユーザに許可されていません.",
6
6
  "error.failed to find x": "{x}が見つかりません.",
7
+ "error.fido2 certificate unsupported": "fido2証明書はサポートされていません",
7
8
  "error.password should match the rule": "パスワードは次の規則を守らなければなりません. {rule}",
8
9
  "error.password used in the past": "過去に使用されたパスワードです.",
9
10
  "error.subdomain not found": "サブドメインが見つかりません.",
@@ -4,6 +4,7 @@
4
4
  "error.domain mismatch": "인증서의 도메인과 현재 도메인이 일치하지 않습니다.",
5
5
  "error.domain not allowed": "'{subdomain}' 영역은 이 사용자에게 허가되지 않았습니다.",
6
6
  "error.failed to find x": "{x}을(를) 찾을 수 없습니다.",
7
+ "error.fido2 certificate unsupported": "제공된 인증서가 올바르지 않거나 지원되지 않는 형식입니다. 다른 로그인 방법을 사용하세요.",
7
8
  "error.password should match the rule": "비밀번호는 다음 규칙을 지켜야 합니다. {rule}",
8
9
  "error.password used in the past": "과거에 사용된 비밀번호입니다.",
9
10
  "error.subdomain not found": "서브도메인을 찾을 수 없습니다.",
@@ -4,6 +4,7 @@
4
4
  "error.domain mismatch": "Sijil tidak sesuai untuk domain ini",
5
5
  "error.domain not allowed": "Pengguna tidak dibenarkan domain `{subdomain}`",
6
6
  "error.failed to find x": "Gagal mencari {x}",
7
+ "error.fido2 certificate unsupported": "sijil fido2 tidak disokong",
7
8
  "error.password should match the rule": "Kata laluan harus mematuhi peraturan berikut. ${rule}",
8
9
  "error.password used in the past": "Kata laluan telah digunakan dalam masa lampau",
9
10
  "error.subdomain not found": "Domain tidak ditemui",
@@ -4,6 +4,7 @@
4
4
  "error.domain mismatch": "证书不适用于该域!",
5
5
  "error.domain not allowed": "用户无权限使用`{subdomain}`域!",
6
6
  "error.failed to find x": "查询{x}失败!",
7
+ "error.fido2 certificate unsupported": "fido2证书不支持",
7
8
  "error.password should match the rule": "密码应符合以下规则。${rule}",
8
9
  "error.password used in the past": "使用过的密码!",
9
10
  "error.subdomain not found": "用户域查询失败!",