fixed stale state after logout and replayed or lost share intents
This commit is contained in:
@@ -17,6 +17,10 @@ Future<void>? _shareFolderReady;
|
||||
Future<void> ensureTalkShareFolder() =>
|
||||
_shareFolderReady ??= _createTalkShareFolder();
|
||||
|
||||
/// The folder is per user; after a sign-out the next account has to check
|
||||
/// again.
|
||||
void resetTalkShareFolderCache() => _shareFolderReady = null;
|
||||
|
||||
Future<void> _createTalkShareFolder() async {
|
||||
try {
|
||||
final webdav = await WebdavApi.webdav;
|
||||
|
||||
@@ -18,7 +18,10 @@ abstract class WebdavApi<T> {
|
||||
/// changes (app password minted/renewed, account switch) so it never keeps
|
||||
/// authenticating with stale credentials.
|
||||
static Future<WebDavClient> get webdav {
|
||||
final secret = AccountData().getNextcloudSecret();
|
||||
// Keyed by user too: two accounts may share a password (no app password
|
||||
// minted), and the client would keep the previous login name.
|
||||
final secret =
|
||||
'${AccountData().getUsername()}:${AccountData().getNextcloudSecret()}';
|
||||
if (_webdav == null || _webdavSecret != secret) {
|
||||
_webdavSecret = secret;
|
||||
_webdav = establishWebdavConnection();
|
||||
|
||||
Reference in New Issue
Block a user