This repository was archived by the owner on Oct 19, 2024. It is now read-only.
Commit 7815ac1 1 parent e95555b commit 7815ac1 Copy full SHA for 7815ac1
File tree 5 files changed +15
-23
lines changed
src/test/kotlin/dev/medzik/librepass/client/api
src/main/kotlin/dev/medzik/librepass/server/controllers/api
5 files changed +15
-23
lines changed Original file line number Diff line number Diff line change 39
39
<dependency >
40
40
<groupId >dev.medzik</groupId >
41
41
<artifactId >otp</artifactId >
42
- <version >1.0.0 </version >
42
+ <version >1.0.1 </version >
43
43
<scope >test</scope >
44
44
</dependency >
45
45
</dependencies >
Original file line number Diff line number Diff line change @@ -20,7 +20,6 @@ class TwoFactorTests {
20
20
OTPParameters .builder()
21
21
.type(OTPType .TOTP )
22
22
.secret(OTPParameters .Secret (twoFactorSecret))
23
- .label(OTPParameters .Label (" " ))
24
23
.build()
25
24
26
25
@BeforeAll
Original file line number Diff line number Diff line change 110
110
<dependency >
111
111
<groupId >dev.medzik</groupId >
112
112
<artifactId >otp</artifactId >
113
- <version >1.0.0 </version >
113
+ <version >1.0.1 </version >
114
114
</dependency >
115
115
116
116
<!-- Handshake Authentication -->
Original file line number Diff line number Diff line change @@ -234,17 +234,14 @@ class AuthController @Autowired constructor(
234
234
235
235
consumeRateLimit(user.email)
236
236
237
- val totpParameters =
238
- OTPParameters .builder()
239
- .type(OTPType .TOTP )
240
- .secret(OTPParameters .Secret (user.twoFactorSecret))
241
- .label(OTPParameters .Label (" " ))
242
- .build()
237
+ val totpParameters = OTPParameters .builder()
238
+ .type(OTPType .TOTP )
239
+ .secret(OTPParameters .Secret (user.twoFactorSecret))
240
+ .build()
243
241
244
242
if (! TOTPGenerator .verify(totpParameters, request.code) &&
245
243
request.code != user.twoFactorRecoveryCode
246
- )
247
- throw ServerException .InvalidTwoFactor ()
244
+ ) throw ServerException .InvalidTwoFactor ()
248
245
249
246
coroutineScope.launch {
250
247
emailService.sendNewLogin(
Original file line number Diff line number Diff line change @@ -222,12 +222,10 @@ class UserController @Autowired constructor(
222
222
if (! validateSharedKey(user, request.sharedKey))
223
223
throw ServerException .InvalidSharedKey ()
224
224
225
- val totpParameters =
226
- OTPParameters .builder()
227
- .type(OTPType .TOTP )
228
- .secret(OTPParameters .Secret (request.secret))
229
- .label(OTPParameters .Label (" " ))
230
- .build()
225
+ val totpParameters = OTPParameters .builder()
226
+ .type(OTPType .TOTP )
227
+ .secret(OTPParameters .Secret (request.secret))
228
+ .build()
231
229
232
230
if (! TOTPGenerator .verify(totpParameters, request.code))
233
231
throw ServerException .InvalidTwoFactor ()
@@ -258,12 +256,10 @@ class UserController @Autowired constructor(
258
256
if (request.code.isNullOrBlank())
259
257
throw ServerException .InvalidTwoFactor ()
260
258
261
- val totpParameters =
262
- OTPParameters .builder()
263
- .type(OTPType .TOTP )
264
- .secret(OTPParameters .Secret (user.twoFactorSecret))
265
- .label(OTPParameters .Label (" " ))
266
- .build()
259
+ val totpParameters = OTPParameters .builder()
260
+ .type(OTPType .TOTP )
261
+ .secret(OTPParameters .Secret (user.twoFactorSecret))
262
+ .build()
267
263
268
264
if (! TOTPGenerator .verify(totpParameters, request.code))
269
265
throw ServerException .InvalidTwoFactor ()
You can’t perform that action at this time.
0 commit comments