Skip to content

Commit efb2708

Browse files
committed
fix: self-review fixes
1 parent 24cd34f commit efb2708

File tree

5 files changed

+6
-7
lines changed

5 files changed

+6
-7
lines changed

src/main/java/io/supertokens/authRecipe/AuthRecipe.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1051,7 +1051,7 @@ public static AuthRecipeUserInfo[] getUsersByAccountInfo(TenantIdentifier tenant
10511051
null);
10521052
}
10531053

1054-
// TODO: revisit this when writing tests
1054+
10551055
public static AuthRecipeUserInfo[] getUsersByAccountInfo(TenantIdentifier tenantIdentifier,
10561056
Storage storage,
10571057
boolean doUnionOfAccountInfo, String email,

src/main/java/io/supertokens/inmemorydb/queries/GeneralQueries.java

-1
Original file line numberDiff line numberDiff line change
@@ -1364,7 +1364,6 @@ public static AuthRecipeUserInfo getPrimaryUserByWebauthNCredentialId(Start star
13641364
TenantIdentifier tenantIdentifier,
13651365
String credentialId)
13661366
throws StorageQueryException, SQLException, StorageTransactionLogicException {
1367-
// TODO: revisit this. Seems like we are loading the same data multiple times
13681367
AuthRecipeUserInfo webauthnUser = start.startTransaction(con -> {
13691368
try {
13701369
Connection sqlCon = (Connection) con.getConnection();

src/main/java/io/supertokens/webauthn/WebAuthN.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ public static WebAuthNSignInUpResult signUp(Storage storage, TenantIdentifier te
298298
AuthRecipeUserInfo userInfo = webAuthNStorage.signUpWithCredentialsRegister_Transaction(
299299
tenantIdentifier, con, recipeUserId, generatedOptions.userEmail,
300300
generatedOptions.relyingPartyId, credentialToSave);
301-
userInfo.setExternalUserId(null); //TODO revisit this
301+
userInfo.setExternalUserId(null);
302302

303303
return new WebAuthNSignInUpResult(credentialToSave, userInfo, generatedOptions);
304304
} catch (DuplicateUserIdException duplicateUserIdException) {
@@ -487,7 +487,7 @@ private static WebAuthNOptions saveGeneratedOptions(TenantIdentifier tenantIdent
487487

488488
public static String generateRecoverAccountToken(Main main, Storage storage, TenantIdentifier tenantIdentifier, String email)
489489
throws NoSuchAlgorithmException, InvalidKeySpecException, TenantOrAppNotFoundException,
490-
StorageQueryException {
490+
StorageQueryException, WebAuthNEmailNotFoundException {
491491
// find the recipe user with the email
492492
AuthRecipeUserInfo[] users = AuthRecipe.getUsersByAccountInfo(tenantIdentifier, storage, true, email, null,
493493
null, null, null);
@@ -538,7 +538,7 @@ tenantIdentifier, new AccountRecoveryTokenInfo(userId,
538538
}
539539

540540
public static AccountRecoveryTokenInfo consumeRecoverAccountToken(Main main, TenantIdentifier tenantIdentifier, Storage storage, String token)
541-
throws StorageQueryException, NoSuchAlgorithmException {
541+
throws StorageQueryException, NoSuchAlgorithmException, InvalidTokenException {
542542
WebAuthNSQLStorage webauthnStorage = StorageUtils.getWebAuthNStorage(storage);
543543

544544
String hashedToken = Utils.hashSHA256(token);

src/main/java/io/supertokens/webauthn/exception/InvalidTokenException.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@
1616

1717
package io.supertokens.webauthn.exception;
1818

19-
public class InvalidTokenException extends RuntimeException {
19+
public class InvalidTokenException extends Exception {
2020
}

src/main/java/io/supertokens/webauthn/exception/WebAuthNEmailNotFoundException.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@
1616

1717
package io.supertokens.webauthn.exception;
1818

19-
public class WebAuthNEmailNotFoundException extends RuntimeException {
19+
public class WebAuthNEmailNotFoundException extends Exception {
2020
}

0 commit comments

Comments
 (0)