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:
parent
854305a108
commit
552bbf2e94
@ -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,
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user