mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
[Authenticator] also check the host part of a given URL
This helps especially in case of a custom URL scheme, so that BITAuthenticator doesn't reset the identification token if a URL is passed in that wasn't meant to parsed by BITAuthenticator. fixes #70
This commit is contained in:
@@ -244,6 +244,12 @@ typedef NS_ENUM(NSUInteger, BITAuthenticatorAppRestrictionEnforcementFrequency)
|
||||
This is required if `identificationType` is set to `BITAuthenticatorIdentificationTypeDevice`.
|
||||
Your app needs to implement the default `ha<APP_ID>` URL scheme or register its own scheme
|
||||
via `urlScheme`.
|
||||
BITAuthenticator checks if the given URL is actually meant to be parsed by it and will
|
||||
return NO if it doesn't think so. It does this by checking the 'host'-part of the URL to be 'authorize', as well
|
||||
as checking the protocol part.
|
||||
Please make sure that if you're using a custom URL scheme, it does _not_ conflict with BITAuthenticator's.
|
||||
If BITAuthenticator thinks the URL was meant to be an authorization URL, but could not find a valid token, it will
|
||||
reset the stored identification token and state.
|
||||
|
||||
Sample usage (in AppDelegate):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user