@adonis-agora/authkit-server 0.69.0 → 0.70.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/build/commands/import_users.js +6 -1
- package/build/index.d.ts +3 -1
- package/build/index.js +5 -1
- package/build/src/accounts/account_store.d.ts +40 -0
- package/build/src/accounts/account_store.js +20 -0
- package/build/src/accounts/lucid_store/mfa.js +22 -0
- package/build/src/audit/audit_sink.d.ts +1 -1
- package/build/src/audit/audit_sink.js +4 -0
- package/build/src/commands/import_users.d.ts +7 -0
- package/build/src/commands/import_users.js +15 -3
- package/build/src/define_config.d.ts +16 -0
- package/build/src/define_config.js +1 -0
- package/build/src/host/account_api/account_api_controller.d.ts +2 -0
- package/build/src/host/account_api/account_api_controller.js +22 -3
- package/build/src/host/account_api/account_mfa_api_controller.d.ts +101 -0
- package/build/src/host/account_api/account_mfa_api_controller.js +286 -0
- package/build/src/host/account_api/account_orgs_api_controller.d.ts +126 -0
- package/build/src/host/account_api/account_orgs_api_controller.js +468 -0
- package/build/src/host/account_lockout.js +7 -2
- package/build/src/host/admin_api/admin_users_service.js +13 -3
- package/build/src/host/admin_api/dto.d.ts +1 -1
- package/build/src/host/admin_validators.d.ts +2 -2
- package/build/src/host/admin_validators.js +3 -2
- package/build/src/host/controllers/account_mfa_controller.js +1 -2
- package/build/src/host/controllers/account_orgs_controller.js +4 -18
- package/build/src/host/controllers/account_security_controller.js +3 -1
- package/build/src/host/controllers/account_session_controller.js +13 -6
- package/build/src/host/controllers/interaction_controller.d.ts +10 -0
- package/build/src/host/controllers/interaction_controller.js +93 -34
- package/build/src/host/controllers/registration_controller.js +35 -9
- package/build/src/host/controllers/social_controller.js +11 -2
- package/build/src/host/email_identifier.d.ts +92 -0
- package/build/src/host/email_identifier.js +234 -0
- package/build/src/host/org_policy.d.ts +26 -0
- package/build/src/host/org_policy.js +35 -0
- package/build/src/host/passkey_registration_challenge.d.ts +12 -0
- package/build/src/host/passkey_registration_challenge.js +12 -0
- package/build/src/host/register_auth_host.js +51 -0
- package/build/src/host/sudo_mode.d.ts +17 -0
- package/build/src/host/sudo_mode.js +31 -12
- package/build/src/host/ui-dist/assets/{index-D9CYQnZR.js → index-Dct63ai-.js} +2 -2
- package/build/src/host/ui-dist/index.html +1 -1
- package/build/src/host/validators.d.ts +5 -5
- package/build/src/host/validators.js +17 -5
- package/package.json +2 -2
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
9
9
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
10
10
|
<link href="https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700&family=JetBrains+Mono:ital,wght@0,400;0,500;0,600;1,400&display=swap" rel="stylesheet">
|
|
11
|
-
<script type="module" crossorigin src="/__AUTHKIT_BASE__/assets/index-
|
|
11
|
+
<script type="module" crossorigin src="/__AUTHKIT_BASE__/assets/index-Dct63ai-.js"></script>
|
|
12
12
|
<link rel="stylesheet" crossorigin href="/__AUTHKIT_BASE__/assets/index-DTSmD4RU.css">
|
|
13
13
|
</head>
|
|
14
14
|
<body>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** Cadastro passwordless: só e-mail + nome (sem senha). O login vem por magic link. */
|
|
2
2
|
export declare const passwordlessSignupValidator: import("@vinejs/vine").VineValidator<import("@vinejs/vine").VineObject<{
|
|
3
|
-
email: import("@vinejs/vine").VineString
|
|
3
|
+
email: import("@vinejs/vine/schema/base/literal").TransformModifier<import("@vinejs/vine").VineString, string>;
|
|
4
4
|
fullName: import("@vinejs/vine").VineString;
|
|
5
5
|
}, {
|
|
6
6
|
email: string;
|
|
@@ -13,7 +13,7 @@ export declare const passwordlessSignupValidator: import("@vinejs/vine").VineVal
|
|
|
13
13
|
fullName: string;
|
|
14
14
|
}>, Record<string, any> | undefined>;
|
|
15
15
|
export declare const signupValidator: import("@vinejs/vine").VineValidator<import("@vinejs/vine").VineObject<{
|
|
16
|
-
email: import("@vinejs/vine").VineString
|
|
16
|
+
email: import("@vinejs/vine/schema/base/literal").TransformModifier<import("@vinejs/vine").VineString, string>;
|
|
17
17
|
fullName: import("@vinejs/vine").VineString;
|
|
18
18
|
password: import("@vinejs/vine").VineString;
|
|
19
19
|
}, {
|
|
@@ -30,7 +30,7 @@ export declare const signupValidator: import("@vinejs/vine").VineValidator<impor
|
|
|
30
30
|
password: string;
|
|
31
31
|
}>, Record<string, any> | undefined>;
|
|
32
32
|
export declare const forgotPasswordValidator: import("@vinejs/vine").VineValidator<import("@vinejs/vine").VineObject<{
|
|
33
|
-
email: import("@vinejs/vine").VineString
|
|
33
|
+
email: import("@vinejs/vine/schema/base/literal").TransformModifier<import("@vinejs/vine").VineString, string>;
|
|
34
34
|
}, {
|
|
35
35
|
email: string;
|
|
36
36
|
}, {
|
|
@@ -75,7 +75,7 @@ export declare const changePasswordValidator: import("@vinejs/vine").VineValidat
|
|
|
75
75
|
*/
|
|
76
76
|
export declare const changeEmailValidator: import("@vinejs/vine").VineValidator<import("@vinejs/vine").VineObject<{
|
|
77
77
|
currentPassword: import("@vinejs/vine/schema/base/literal").OptionalModifier<import("@vinejs/vine").VineString>;
|
|
78
|
-
newEmail: import("@vinejs/vine").VineString
|
|
78
|
+
newEmail: import("@vinejs/vine/schema/base/literal").TransformModifier<import("@vinejs/vine").VineString, string>;
|
|
79
79
|
}, {
|
|
80
80
|
currentPassword?: string | null | undefined;
|
|
81
81
|
newEmail: string;
|
|
@@ -123,7 +123,7 @@ export declare const deleteAccountValidator: import("@vinejs/vine").VineValidato
|
|
|
123
123
|
}>, Record<string, any> | undefined>;
|
|
124
124
|
/** Criação de usuário no console admin (email obrigatório; nome/senha opcionais). */
|
|
125
125
|
export declare const adminCreateUserValidator: import("@vinejs/vine").VineValidator<import("@vinejs/vine").VineObject<{
|
|
126
|
-
email: import("@vinejs/vine").VineString
|
|
126
|
+
email: import("@vinejs/vine/schema/base/literal").TransformModifier<import("@vinejs/vine").VineString, string>;
|
|
127
127
|
name: import("@vinejs/vine/schema/base/literal").OptionalModifier<import("@vinejs/vine").VineString>;
|
|
128
128
|
password: import("@vinejs/vine/schema/base/literal").OptionalModifier<import("@vinejs/vine").VineString>;
|
|
129
129
|
}, {
|
|
@@ -1,16 +1,28 @@
|
|
|
1
1
|
import vine from '@vinejs/vine';
|
|
2
|
+
import { normalizeEmailIdentifier } from './email_identifier.js';
|
|
3
|
+
/**
|
|
4
|
+
* E-mail usado como IDENTIDADE da conta. Normalização ÚNICA e conservadora
|
|
5
|
+
* ({@link normalizeEmailIdentifier}: `trim` + `toLowerCase`) — a MESMA aplicada
|
|
6
|
+
* no passo de identificador do login, para que os dois lados concordem.
|
|
7
|
+
*
|
|
8
|
+
* NÃO use `.normalizeEmail()` do VineJS aqui: ele aplica os defaults do
|
|
9
|
+
* validator.js, que no gmail REMOVEM os pontos e o sub-endereço `+tag` — a
|
|
10
|
+
* conta nascia com um endereço diferente do digitado e a pessoa ficava trancada
|
|
11
|
+
* do lado de fora (ver `host/email_identifier.ts`).
|
|
12
|
+
*/
|
|
13
|
+
const emailIdentifier = () => vine.string().trim().email().transform(normalizeEmailIdentifier);
|
|
2
14
|
/** Cadastro passwordless: só e-mail + nome (sem senha). O login vem por magic link. */
|
|
3
15
|
export const passwordlessSignupValidator = vine.compile(vine.object({
|
|
4
|
-
email:
|
|
16
|
+
email: emailIdentifier(),
|
|
5
17
|
fullName: vine.string().trim().minLength(2).maxLength(255),
|
|
6
18
|
}));
|
|
7
19
|
export const signupValidator = vine.compile(vine.object({
|
|
8
|
-
email:
|
|
20
|
+
email: emailIdentifier(),
|
|
9
21
|
fullName: vine.string().trim().minLength(2).maxLength(255),
|
|
10
22
|
password: vine.string().minLength(8).maxLength(255),
|
|
11
23
|
}));
|
|
12
24
|
export const forgotPasswordValidator = vine.compile(vine.object({
|
|
13
|
-
email:
|
|
25
|
+
email: emailIdentifier(),
|
|
14
26
|
}));
|
|
15
27
|
export const resetPasswordValidator = vine.compile(vine.object({
|
|
16
28
|
token: vine.string().trim().minLength(1),
|
|
@@ -31,7 +43,7 @@ export const changePasswordValidator = vine.compile(vine.object({
|
|
|
31
43
|
*/
|
|
32
44
|
export const changeEmailValidator = vine.compile(vine.object({
|
|
33
45
|
currentPassword: vine.string().minLength(1).optional(),
|
|
34
|
-
newEmail:
|
|
46
|
+
newEmail: emailIdentifier(),
|
|
35
47
|
}));
|
|
36
48
|
/**
|
|
37
49
|
* Edição de perfil no console de conta: nome e avatarUrl, ambos opcionais.
|
|
@@ -52,7 +64,7 @@ export const deleteAccountValidator = vine.compile(vine.object({
|
|
|
52
64
|
}));
|
|
53
65
|
/** Criação de usuário no console admin (email obrigatório; nome/senha opcionais). */
|
|
54
66
|
export const adminCreateUserValidator = vine.compile(vine.object({
|
|
55
|
-
email:
|
|
67
|
+
email: emailIdentifier(),
|
|
56
68
|
name: vine.string().trim().maxLength(255).optional(),
|
|
57
69
|
password: vine.string().minLength(8).maxLength(255).optional(),
|
|
58
70
|
}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adonis-agora/authkit-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.70.0",
|
|
4
4
|
"description": "AdonisJS OIDC/OAuth2 provider (Identity Provider) toolkit: ejectable auth server with sessions, rate-limiting, MFA/TOTP, audit log, federated logout and OpenTelemetry metrics.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "dudousxd",
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
"qrcode": "1.5.4"
|
|
114
114
|
},
|
|
115
115
|
"devDependencies": {
|
|
116
|
-
"@adonis-agora/authkit-react": "0.
|
|
116
|
+
"@adonis-agora/authkit-react": "0.22.0",
|
|
117
117
|
"@adonis-agora/durable": "0.40.0",
|
|
118
118
|
"@adonis-agora/telescope": "0.21.1",
|
|
119
119
|
"@adonisjs/ally": "6.3.0",
|