parent
54e7bd81d5
commit
5ab2f86b66
6 changed files with 23 additions and 0 deletions
|
|
@ -221,6 +221,11 @@ public class MattermostManagedModule extends ReactContextBaseJavaModule {
|
|||
}
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void invalidateKeychainCache(String serverUrl) {
|
||||
// Not using cache
|
||||
}
|
||||
|
||||
private static class SaveDataTask extends GuardedResultAsyncTask<Object> {
|
||||
private final WeakReference<Context> weakContext;
|
||||
private final String fromFile;
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import {getThemeFromState} from '@screens/navigation';
|
|||
import EphemeralStore from '@store/ephemeral_store';
|
||||
import {deleteFileCache, deleteFileCacheByDir} from '@utils/file';
|
||||
import {isMainActivity} from '@utils/helpers';
|
||||
import {invalidateKeychainCache} from '@utils/mattermost_managed';
|
||||
import {addNewServer} from '@utils/server';
|
||||
|
||||
import type {LaunchType} from '@typings/launch';
|
||||
|
|
@ -115,6 +116,7 @@ class SessionManager {
|
|||
private terminateSession = async (serverUrl: string, removeServer: boolean) => {
|
||||
cancelSessionNotification(serverUrl);
|
||||
await removeServerCredentials(serverUrl);
|
||||
invalidateKeychainCache(serverUrl);
|
||||
PushNotifications.removeServerNotifications(serverUrl);
|
||||
|
||||
NetworkManager.invalidateClient(serverUrl);
|
||||
|
|
|
|||
|
|
@ -64,3 +64,7 @@ export const deleteEntititesFile = (callback?: (success: boolean) => void) => {
|
|||
callback(true);
|
||||
}
|
||||
};
|
||||
|
||||
export const invalidateKeychainCache = (serverUrl: string) => {
|
||||
MattermostManaged.invalidateKeychainCache(serverUrl);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -100,6 +100,10 @@ public class Keychain: NSObject {
|
|||
|
||||
return nil
|
||||
}
|
||||
|
||||
public func invalidateToken(for serverUrl: String) {
|
||||
tokenCache.removeValue(forKey: serverUrl)
|
||||
}
|
||||
|
||||
private func buildIdentityQuery(for host: String) throws -> [CFString: Any] {
|
||||
guard let hostData = host.data(using: .utf8) else {
|
||||
|
|
|
|||
|
|
@ -42,4 +42,8 @@ import Gekidou
|
|||
|
||||
return nil
|
||||
}
|
||||
|
||||
@objc func invalidateToken(for url: String) {
|
||||
Keychain.default.invalidateToken(for: url)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -153,6 +153,10 @@ RCT_EXPORT_METHOD(removeListeners:(double)count) {
|
|||
// Keep: Required for RN built in Event Emitter Calls.
|
||||
}
|
||||
|
||||
RCT_EXPORT_METHOD(invalidateKeychainCache:(NSString *) serverUrl)
|
||||
{
|
||||
[[GekidouWrapper default] invalidateTokenFor:serverUrl];
|
||||
}
|
||||
|
||||
RCT_EXPORT_METHOD(createThumbnail:(NSDictionary *)config findEventsWithResolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue