1
1
mirror of https://github.com/VKCOM/vk-ios-sdk.git synced 2024-09-11 06:45:37 +03:00

Add option for disabling authorization providers (#598)

Co-authored-by: Alekseev Sergei <sn.alekseev@corp.vk.com>
This commit is contained in:
Sergei Alexeev 2022-09-29 19:53:56 +03:00 committed by GitHub
parent 854305a108
commit 552bbf2e94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -48,6 +48,8 @@ typedef NS_OPTIONS(NSUInteger, VKAuthorizationOptions) {
VKAuthorizationOptionsUnlimitedToken = 1 << 0,
///Pass this option to disable usage of SFSafariViewController
VKAuthorizationOptionsDisableSafariController = 1 << 1,
///Pass this option to disable usage of authorization providers
VKAuthorizationOptionsDisableProviders = 1 << 2,
};
/**

View File

@ -156,8 +156,10 @@ static NSString *VK_ACCESS_TOKEN_DEFAULTS_KEY = @"VK_ACCESS_TOKEN_DEFAULTS_KEY_D
instance.permissions = [permissionsSet copy];
permissions = [permissionsSet allObjects];
BOOL providersEnabled = !(options & VKAuthorizationOptionsDisableProviders);
BOOL vkApp = [self vkAppMayExists]
&& instance.authState == VKAuthorizationInitialized;
&& instance.authState == VKAuthorizationInitialized && providersEnabled;
BOOL safariEnabled = !(options & VKAuthorizationOptionsDisableSafariController);