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

Remove deprecated methods & properties #733

Merged
merged 2 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,12 @@ sealed interface ExternalAuthAction {
data class CustomTabs(val intentBuilder: CustomTabsIntent.Builder.() -> Unit = {}) : ExternalAuthAction

companion object {

/**
* The default action to use for the OAuth flow
*/
val DEFAULT: ExternalAuthAction = ExternalBrowser

/**
* External browser action
*/
@Deprecated("Use ExternalBrowser object instead", ReplaceWith("ExternalAuthAction.ExternalBrowser"))
val EXTERNAL_BROWSER: ExternalAuthAction = ExternalBrowser

/**
* Custom tabs action
*/
@Deprecated("Use CustomTabs class instead", ReplaceWith("ExternalAuthAction.CustomTabs()"))
val CUSTOM_TABS: ExternalAuthAction = CustomTabs()
}

}
15 changes: 0 additions & 15 deletions Auth/src/commonMain/kotlin/io/github/jan/supabase/auth/Auth.kt
Original file line number Diff line number Diff line change
Expand Up @@ -202,21 +202,6 @@ sealed interface Auth : MainPlugin<AuthConfig>, CustomSerializationPlugin {
config: UserUpdateBuilder.() -> Unit
): UserInfo

/**
* Modifies the current user
* @param updateCurrentUser Whether to update the current user in the [SupabaseClient]
* @param config The configuration to use
* @throws RestException or one of its subclasses if receiving an error response. If the error response contains a error code, an [AuthRestException] will be thrown which can be used to easier identify the problem.
* @throws HttpRequestTimeoutException if the request timed out
* @throws HttpRequestException on network related issues
*/
@Deprecated("Use updateUser instead")
suspend fun modifyUser(
updateCurrentUser: Boolean = true,
redirectUrl: String? = defaultRedirectUrl(),
config: UserUpdateBuilder.() -> Unit
): UserInfo = updateUser(updateCurrentUser, redirectUrl, config)

/**
* Resends an existing signup confirmation email, email change email
* @param type The email otp type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,43 +37,12 @@ sealed interface MfaApi {
*/
val statusFlow: Flow<MfaStatus>

/**
* Checks whether the current session was authenticated with MFA or the user has a verified MFA factor. Note that if the user has verified a factor on another device and the user hasn't been updated on this device, this will return false.
* You can use [Auth.retrieveUserForCurrentSession] to update the user and this property will update.
*/
@Deprecated("Use statusFlow instead", ReplaceWith("statusFlow"))
val isMfaEnabledFlow: Flow<Boolean>

/**
* Checks whether the user has a verified MFA factor. Note that if the user has verified a factor on another device and the user hasn't been updated on this device, this will return false.
* You can use [Auth.retrieveUserForCurrentSession] to update the user and this property will update.
*/
@Deprecated("Use status.enabled instead", ReplaceWith("status.enabled"))
val isMfaEnabled: Boolean
get() {
val mfaLevel = getAuthenticatorAssuranceLevel()
return mfaLevel.next == AuthenticatorAssuranceLevel.AAL2
}

/**
* Returns all verified factors from the current user session. If the user has no verified factors or there is no session, an empty list is returned.
* To fetch up-to-date factors, use [retrieveFactorsForCurrentUser].
*/
val verifiedFactors: List<UserMfaFactor>

/**
* Checks whether the current session is authenticated with MFA
*/
@Deprecated("Use status.active instead", ReplaceWith("status.active"))
val loggedInUsingMfa: Boolean
get() = getAuthenticatorAssuranceLevel().current == AuthenticatorAssuranceLevel.AAL2

/**
* Checks whether the current session is authenticated with MFA
*/
@Deprecated("Use statusFlow instead", ReplaceWith("statusFlow"))
val loggedInUsingMfaFlow: Flow<Boolean>

/**
* @param factorType The type of MFA factor to enroll. Currently only supports TOTP.
* @param friendlyName Human-readable name assigned to a device
Expand Down Expand Up @@ -156,10 +125,6 @@ internal class MfaApiImpl(
}
}

@Deprecated("Use statusFlow instead", replaceWith = ReplaceWith("statusFlow"))
override val isMfaEnabledFlow: Flow<Boolean> = statusFlow.map { it.enabled }
@Deprecated("Use statusFlow instead", replaceWith = ReplaceWith("statusFlow"))
override val loggedInUsingMfaFlow: Flow<Boolean> = statusFlow.map { it.active }
override val verifiedFactors: List<UserMfaFactor>
get() = auth.currentUserOrNull()?.factors?.filter(UserMfaFactor::isVerified) ?: emptyList()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import io.github.jan.supabase.postgrest.query.filter.FilterOperator
/**
* Used to filter postgres changes
*/
@Suppress("DEPRECATION")
class PostgresChangeFilter(private val event: String, private val schema: String) {

/**
Expand All @@ -20,7 +19,7 @@ class PostgresChangeFilter(private val event: String, private val schema: String
* E.g.: "user_id=eq.1"
*/
var filter: String? = null
@Deprecated("Use the new `filter` method instead") set
private set

/**
* Filters the received changes in your table.
Expand Down