@factiii/auth 0.3.0 → 0.4.1
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/README.md +5 -1
- package/dist/{chunk-PYVDWODF.mjs → chunk-EHI4P63M.mjs} +0 -21
- package/dist/{hooks-B41uikq7.d.mts → hooks-yHGJ7C6_.d.mts} +3 -57
- package/dist/{hooks-B41uikq7.d.ts → hooks-yHGJ7C6_.d.ts} +3 -57
- package/dist/index.d.mts +39 -55
- package/dist/index.d.ts +39 -55
- package/dist/index.js +97 -193
- package/dist/index.mjs +93 -173
- package/dist/validators.d.mts +1 -1
- package/dist/validators.d.ts +1 -1
- package/dist/validators.js +0 -26
- package/dist/validators.mjs +1 -11
- package/package.json +1 -1
- package/prisma/schema.prisma +17 -19
package/dist/validators.mjs
CHANGED
|
@@ -8,21 +8,16 @@ import {
|
|
|
8
8
|
endAllSessionsSchema,
|
|
9
9
|
getTwofaSecretSchema,
|
|
10
10
|
loginSchema,
|
|
11
|
-
logoutSchema,
|
|
12
11
|
oAuthLoginSchema,
|
|
13
|
-
otpLoginRequestSchema,
|
|
14
|
-
otpLoginVerifySchema,
|
|
15
12
|
registerPushTokenSchema,
|
|
16
13
|
requestPasswordResetSchema,
|
|
17
|
-
resendVerificationSchema,
|
|
18
14
|
resetPasswordSchema,
|
|
19
15
|
signupSchema,
|
|
20
16
|
twoFaResetSchema,
|
|
21
17
|
twoFaResetVerifySchema,
|
|
22
|
-
twoFaSetupSchema,
|
|
23
18
|
twoFaVerifySchema,
|
|
24
19
|
verifyEmailSchema
|
|
25
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-EHI4P63M.mjs";
|
|
26
21
|
export {
|
|
27
22
|
biometricVerifySchema,
|
|
28
23
|
changePasswordSchema,
|
|
@@ -33,18 +28,13 @@ export {
|
|
|
33
28
|
endAllSessionsSchema,
|
|
34
29
|
getTwofaSecretSchema,
|
|
35
30
|
loginSchema,
|
|
36
|
-
logoutSchema,
|
|
37
31
|
oAuthLoginSchema,
|
|
38
|
-
otpLoginRequestSchema,
|
|
39
|
-
otpLoginVerifySchema,
|
|
40
32
|
registerPushTokenSchema,
|
|
41
33
|
requestPasswordResetSchema,
|
|
42
|
-
resendVerificationSchema,
|
|
43
34
|
resetPasswordSchema,
|
|
44
35
|
signupSchema,
|
|
45
36
|
twoFaResetSchema,
|
|
46
37
|
twoFaResetVerifySchema,
|
|
47
|
-
twoFaSetupSchema,
|
|
48
38
|
twoFaVerifySchema,
|
|
49
39
|
verifyEmailSchema
|
|
50
40
|
};
|
package/package.json
CHANGED
package/prisma/schema.prisma
CHANGED
|
@@ -59,7 +59,7 @@ model User {
|
|
|
59
59
|
// Relations
|
|
60
60
|
sessions Session[]
|
|
61
61
|
passwordReset PasswordReset[]
|
|
62
|
-
|
|
62
|
+
otps OTP[]
|
|
63
63
|
devices Device[] @relation("devices")
|
|
64
64
|
admin Admin?
|
|
65
65
|
}
|
|
@@ -69,18 +69,17 @@ model User {
|
|
|
69
69
|
// ==============================================================================
|
|
70
70
|
|
|
71
71
|
model Session {
|
|
72
|
-
id
|
|
73
|
-
socketId
|
|
74
|
-
twoFaSecret
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
userId
|
|
82
|
-
|
|
83
|
-
revokedAt DateTime?
|
|
72
|
+
id Int @id @default(autoincrement())
|
|
73
|
+
socketId String? @unique
|
|
74
|
+
twoFaSecret String? @unique
|
|
75
|
+
issuedAt DateTime @default(now())
|
|
76
|
+
browserName String @default("Unknown")
|
|
77
|
+
lastUsed DateTime @default(now()) @updatedAt
|
|
78
|
+
device Device? @relation(fields: [deviceId], references: [id])
|
|
79
|
+
deviceId Int?
|
|
80
|
+
userId Int
|
|
81
|
+
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
82
|
+
revokedAt DateTime?
|
|
84
83
|
|
|
85
84
|
@@index([userId])
|
|
86
85
|
@@index([deviceId])
|
|
@@ -113,16 +112,15 @@ model PasswordReset {
|
|
|
113
112
|
}
|
|
114
113
|
|
|
115
114
|
// ==============================================================================
|
|
116
|
-
//
|
|
115
|
+
// OTP Model
|
|
117
116
|
// ==============================================================================
|
|
118
117
|
|
|
119
|
-
model
|
|
120
|
-
id Int @id @default(autoincrement())
|
|
118
|
+
model OTP {
|
|
121
119
|
code Int
|
|
122
|
-
|
|
120
|
+
expiredAt DateTime
|
|
121
|
+
userId Int @unique
|
|
123
122
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
124
|
-
|
|
125
|
-
disabled Boolean @default(false)
|
|
123
|
+
|
|
126
124
|
}
|
|
127
125
|
|
|
128
126
|
// ==============================================================================
|