Skip to content

Commit

Permalink
clear session when receiving session not found
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-tennert committed May 16, 2024
1 parent 02a2fa6 commit f269c50
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,13 @@ internal class AuthImpl(
private fun checkErrorCodes(error: GoTrueErrorResponse): RestException? {
return when (error.error) {
AuthWeakPasswordException.CODE -> AuthWeakPasswordException(error.error, error.weakPassword?.reasons ?: emptyList())
AuthSessionMissingException.CODE -> AuthSessionMissingException() //TODO: Sign-out
AuthSessionMissingException.CODE -> {
authScope.launch {
Auth.logger.e { "Received session not found api error. Clearing session..." }
clearSession()
}
AuthSessionMissingException()
}
else -> null
}
}
Expand Down

0 comments on commit f269c50

Please sign in to comment.