Merge pull request #5293 from vector-im/langleyd/5292_refresh_tokens

App: Refresh Tokens Implementation
This commit is contained in:
David Langley
2022-01-31 08:59:19 +00:00
committed by GitHub
23 changed files with 511 additions and 272 deletions
+13 -1
View File
@@ -96,7 +96,7 @@ import AnalyticsEvents
// Catch and log crashes
MXLogger.logCrashes(true)
MXLogger.setBuildVersion(AppDelegate.theDelegate().build)
MXLogger.setBuildVersion(AppInfo.current.buildInfo.readableBuildVersion)
}
/// Use the analytics settings from the supplied session to configure analytics.
@@ -213,6 +213,18 @@ extension Analytics {
}
}
/// Track when a user becomes unauthenticated without pressing the `sign out` button.
/// - Parameters:
/// - softLogout: Wether it was a soft/hard logout that was triggered.
/// - refreshTokenAuth: Wether it was either an access-token-based or refresh-token-based auth mechanism enabled.
/// - errorCode: The error code as returned by the homeserver that triggered the logout.
/// - errorReason: The reason for the error as returned by the homeserver that triggered the logout.
func trackAuthUnauthenticatedError(softLogout: Bool, refreshTokenAuth: Bool, errorCode: String, errorReason: String) {
let errorCode = AnalyticsEvent.UnauthenticatedError.ErrorCode(rawValue: errorCode) ?? .M_UNKNOWN
let event = AnalyticsEvent.UnauthenticatedError(errorCode: errorCode, errorReason: errorReason, refreshTokenAuth: refreshTokenAuth, softLogout: softLogout)
client.capture(event)
}
/// Track whether the user accepted or declined the terms to an identity server.
/// **Note** This method isn't currently implemented.
/// - Parameter accepted: Whether the terms were accepted.