Do not restore session with invalid token.
This commit is contained in:
committed by
Benoit Marty
parent
266f93cc28
commit
6be984efc8
+5
-1
@@ -76,7 +76,11 @@ class RustMatrixAuthenticationService @Inject constructor(
|
||||
runCatching {
|
||||
val sessionData = sessionStore.getSession(sessionId.value)
|
||||
if (sessionData != null) {
|
||||
rustMatrixClientFactory.create(sessionData)
|
||||
if (sessionData.isTokenValid) {
|
||||
rustMatrixClientFactory.create(sessionData)
|
||||
} else {
|
||||
error("Token is not valid")
|
||||
}
|
||||
} else {
|
||||
error("No session to restore with id $sessionId")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user