internal static void RegisterProvider(IParseAuthenticationProvider provider) { authProviders[provider.AuthType] = provider; var curUser = ParseUser.CurrentUser; if (curUser != null) { curUser.SynchronizeAuthData(provider); } }
private void SynchronizeAuthData(IParseAuthenticationProvider provider) { bool restorationSuccess = false; lock (mutex) { var authData = AuthData; if (authData == null || provider == null) { return; } IDictionary <string, object> data; if (authData.TryGetValue(provider.AuthType, out data)) { restorationSuccess = provider.RestoreAuthentication(data); } } if (!restorationSuccess) { this.UnlinkFromAsync(provider.AuthType, CancellationToken.None); } }
private void SynchronizeAuthData(IParseAuthenticationProvider provider) { bool restorationSuccess = false; lock (mutex) { var authData = AuthData; if (authData == null || provider == null) { return; } IDictionary<string, object> data; if (authData.TryGetValue(provider.AuthType, out data)) { restorationSuccess = provider.RestoreAuthentication(data); } } if (!restorationSuccess) { this.UnlinkFromAsync(provider.AuthType, CancellationToken.None); } }