@adminforth/two-factors-auth 4.2.2 → 4.2.4
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/dist/types.d.ts +3 -3
- package/package.json +3 -3
- package/pnpm-workspace.yaml +1 -1
- package/services/passkeyService.ts +2 -2
- package/types.ts +3 -3
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AdminUser, KeyValueAdapter } from "adminforth";
|
|
2
|
-
import { type PluginsCommonOptions } from "adminforth";
|
|
2
|
+
import { type PluginsCommonOptions, PeriodString } from "adminforth";
|
|
3
3
|
export interface PluginOptions extends PluginsCommonOptions {
|
|
4
4
|
/**
|
|
5
5
|
* Name of the field in the auth resource which will store 2FA secret.
|
|
@@ -46,11 +46,11 @@ export interface PluginOptions extends PluginsCommonOptions {
|
|
|
46
46
|
/**
|
|
47
47
|
* Period between showing alert suggesting to set up Passkeys if not set up yet.
|
|
48
48
|
*/
|
|
49
|
-
suggestionPeriod?:
|
|
49
|
+
suggestionPeriod?: PeriodString;
|
|
50
50
|
/**
|
|
51
51
|
* Challenge period for Passkeys authentication.
|
|
52
52
|
*/
|
|
53
|
-
challengeValidityPeriod?:
|
|
53
|
+
challengeValidityPeriod?: PeriodString;
|
|
54
54
|
/**
|
|
55
55
|
* Passkeys settings for WebAuthn API.
|
|
56
56
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adminforth/two-factors-auth",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.4",
|
|
4
4
|
"description": "AdminForth plugin for two factors authentication",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
"node-2fa": "^2.0.3"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"adminforth": "^3.
|
|
31
|
+
"adminforth": "^3.6.21"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@types/node": "^22.10.7",
|
|
35
|
-
"adminforth": "^3.
|
|
35
|
+
"adminforth": "^3.6.21",
|
|
36
36
|
"semantic-release": "^24.2.1",
|
|
37
37
|
"semantic-release-slack-bot": "^4.0.2",
|
|
38
38
|
"typescript": "^5.7.3"
|
package/pnpm-workspace.yaml
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { convertPeriodToSeconds } from "adminforth";
|
|
2
|
-
import type { AdminUser, IAdminForth, IAdminForthHttpResponse } from "adminforth";
|
|
2
|
+
import type { AdminUser, IAdminForth, IAdminForthHttpResponse, PeriodString } from "adminforth";
|
|
3
3
|
import {
|
|
4
4
|
generateRegistrationOptions,
|
|
5
5
|
verifyRegistrationResponse,
|
|
@@ -39,7 +39,7 @@ export class PasskeyService {
|
|
|
39
39
|
private readonly cookieService = new CookieService(adminforth, options),
|
|
40
40
|
) {}
|
|
41
41
|
|
|
42
|
-
private async markChallengeAsUsed(challenge: string, expiresIn?:
|
|
42
|
+
private async markChallengeAsUsed(challenge: string, expiresIn?: PeriodString): Promise<void> {
|
|
43
43
|
const expiresInSeconds = expiresIn ? convertPeriodToSeconds(expiresIn) : undefined;
|
|
44
44
|
await this.options.passkeys.keyValueAdapter.set(challenge, 'stub_value', expiresInSeconds);
|
|
45
45
|
}
|
package/types.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AdminUser, KeyValueAdapter } from "adminforth";
|
|
2
|
-
import {type PluginsCommonOptions } from "adminforth";
|
|
2
|
+
import {type PluginsCommonOptions, PeriodString } from "adminforth";
|
|
3
3
|
|
|
4
4
|
export interface PluginOptions extends PluginsCommonOptions {
|
|
5
5
|
|
|
@@ -58,11 +58,11 @@ export interface PluginOptions extends PluginsCommonOptions {
|
|
|
58
58
|
/**
|
|
59
59
|
* Period between showing alert suggesting to set up Passkeys if not set up yet.
|
|
60
60
|
*/
|
|
61
|
-
suggestionPeriod?:
|
|
61
|
+
suggestionPeriod?: PeriodString; // e.g. '30d', '12h', '15m'. Default is '5d'
|
|
62
62
|
/**
|
|
63
63
|
* Challenge period for Passkeys authentication.
|
|
64
64
|
*/
|
|
65
|
-
challengeValidityPeriod?:
|
|
65
|
+
challengeValidityPeriod?: PeriodString; // e.g. '5m', '10m', '15m'. Default is '1m'
|
|
66
66
|
/**
|
|
67
67
|
* Passkeys settings for WebAuthn API.
|
|
68
68
|
*/
|