@arkstack/auth 0.12.12 → 0.12.13
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/index.d.ts +7 -6
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference path="./app.d.ts" />
|
|
2
2
|
import { Exception } from "@arkstack/common";
|
|
3
3
|
import { Request, RequestSource, Response, ResponseSource, Session } from "@arkstack/http";
|
|
4
|
+
import * as _$otpauth from "otpauth";
|
|
4
5
|
import { Model } from "@arkstack/database";
|
|
5
6
|
|
|
6
7
|
//#region src/Contracts/PersonalAccessToken.d.ts
|
|
@@ -474,7 +475,7 @@ declare class TwoFactor {
|
|
|
474
475
|
* @param secret
|
|
475
476
|
* @returns
|
|
476
477
|
*/
|
|
477
|
-
static getTotp(user: User, secret: string):
|
|
478
|
+
static getTotp(user: User, secret: string): _$otpauth.TOTP;
|
|
478
479
|
/**
|
|
479
480
|
* Generate a new shared secret for authenticator-based 2FA.
|
|
480
481
|
*
|
|
@@ -506,7 +507,7 @@ declare class TwoFactor {
|
|
|
506
507
|
* @param userId The ID of the user.
|
|
507
508
|
* @returns The stored secret, or null if not found.
|
|
508
509
|
*/
|
|
509
|
-
static getSecret(userId: User['id']): Promise<
|
|
510
|
+
static getSecret(userId: User['id']): Promise<string | null>;
|
|
510
511
|
/**
|
|
511
512
|
* Store the setup secret for a user.
|
|
512
513
|
*
|
|
@@ -521,7 +522,7 @@ declare class TwoFactor {
|
|
|
521
522
|
* @param userId The ID of the user.
|
|
522
523
|
* @returns The timestamp when 2FA was enabled, or null if not enabled.
|
|
523
524
|
*/
|
|
524
|
-
static getEnabledAt(userId: User['id']): Promise<
|
|
525
|
+
static getEnabledAt(userId: User['id']): Promise<string | null>;
|
|
525
526
|
/**
|
|
526
527
|
* Persist the timestamp marking 2FA as enabled.
|
|
527
528
|
*
|
|
@@ -547,14 +548,14 @@ declare class TwoFactor {
|
|
|
547
548
|
* @param codes An array of recovery codes to hash.
|
|
548
549
|
* @returns An array of hashed recovery codes.
|
|
549
550
|
*/
|
|
550
|
-
static hashBackupCodes(codes: string[]): Promise<
|
|
551
|
+
static hashBackupCodes(codes: string[]): Promise<string[]>;
|
|
551
552
|
/**
|
|
552
553
|
* Read stored recovery-code hashes for a user.
|
|
553
554
|
*
|
|
554
555
|
* @param userId The ID of the user.
|
|
555
556
|
* @returns An array of recovery-code hashes.
|
|
556
557
|
*/
|
|
557
|
-
static readRecoveryCodeHashes(userId: User['id']): Promise<
|
|
558
|
+
static readRecoveryCodeHashes(userId: User['id']): Promise<string[]>;
|
|
558
559
|
/**
|
|
559
560
|
* Persist recovery-code hashes on the user's dedicated 2FA record.
|
|
560
561
|
*
|
|
@@ -594,7 +595,7 @@ declare class TwoFactor {
|
|
|
594
595
|
* @param purpose
|
|
595
596
|
* @returns
|
|
596
597
|
*/
|
|
597
|
-
static verifySmsCode(userId: User['id'], code: string, purpose: SmsCodePurpose): Promise<
|
|
598
|
+
static verifySmsCode(userId: User['id'], code: string, purpose: SmsCodePurpose): Promise<boolean>;
|
|
598
599
|
}
|
|
599
600
|
//#endregion
|
|
600
601
|
//#region src/Contracts/UserTwoFactor.d.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arkstack/auth",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Authentication module for Arkstack, providing core authentication and identity features.",
|
|
6
6
|
"homepage": "https://arkstack.toneflix.net/guide/auth",
|
|
@@ -38,12 +38,12 @@
|
|
|
38
38
|
"jose": "^6.2.3",
|
|
39
39
|
"otpauth": "^9.5.1",
|
|
40
40
|
"ua-parser-js": "^2.0.9",
|
|
41
|
-
"@arkstack/common": "^0.12.
|
|
42
|
-
"@arkstack/http": "^0.12.
|
|
41
|
+
"@arkstack/common": "^0.12.13",
|
|
42
|
+
"@arkstack/http": "^0.12.13"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"@h3ravel/support": "^0.15.11",
|
|
46
|
-
"@arkstack/database": "^0.12.
|
|
46
|
+
"@arkstack/database": "^0.12.13"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
49
49
|
"build": "tsdown --config-loader unrun",
|