Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Replace TotpNotEnabledError with UnknownUserIdTotpError #106

Merged
merged 12 commits into from
Sep 28, 2023
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

- Replace `TotpNotEnabledException` with `UnknownUserTotpIdException`.

## [4.0.0] - 2023-09-19

- Adds support for account linking
Expand Down Expand Up @@ -68,7 +70,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.22.0] - 2023-03-30

- Adds Support for Dashboard Search
- Adds Support for Dashboard Search

## [2.21.0] - 2023-03-27

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package io.supertokens.pluginInterface.totp.exception;

public class TotpNotEnabledException extends Exception {
public class UnknownTotpUserIdException extends Exception {
private static final long serialVersionUID = 6848053563771647272L;
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
import io.supertokens.pluginInterface.totp.TOTPDevice;
import io.supertokens.pluginInterface.totp.TOTPStorage;
import io.supertokens.pluginInterface.totp.TOTPUsedCode;
import io.supertokens.pluginInterface.totp.exception.TotpNotEnabledException;
import io.supertokens.pluginInterface.totp.exception.DeviceAlreadyExistsException;
import io.supertokens.pluginInterface.totp.exception.UsedCodeAlreadyExistsException;
import io.supertokens.pluginInterface.totp.exception.UnknownTotpUserIdException;

public interface TOTPSQLStorage extends TOTPStorage, SQLStorage {
public int deleteDevice_Transaction(TransactionConnection con, AppIdentifier appIdentifier, String userId,
Expand Down Expand Up @@ -38,7 +39,11 @@ public TOTPUsedCode[] getAllUsedCodesDescOrder_Transaction(TransactionConnection
* Insert a used TOTP code for an existing user:
*/
void insertUsedCode_Transaction(TransactionConnection con, TenantIdentifier tenantIdentifier, TOTPUsedCode code)
throws StorageQueryException, TotpNotEnabledException, UsedCodeAlreadyExistsException,
throws StorageQueryException, UnknownTotpUserIdException, UsedCodeAlreadyExistsException,
TenantOrAppNotFoundException;

TOTPDevice getDeviceByName_Transaction(TransactionConnection con, AppIdentifier appIdentifier, String userId, String deviceName) throws StorageQueryException;

TOTPDevice createDevice_Transaction(TransactionConnection con, AppIdentifier appIdentifier, TOTPDevice device)
throws StorageQueryException, DeviceAlreadyExistsException, TenantOrAppNotFoundException;
}