File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Sources/CryptomatorCloudAccess/MicrosoftGraph Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,8 @@ import UIKit
1515
1616public enum MicrosoftGraphAuthenticatorError : Error {
1717 case missingAccountIdentifier
18+ case serverDeclinedScopes
19+ case userCanceled
1820}
1921
2022public class MicrosoftGraphAuthenticator {
@@ -27,6 +29,15 @@ public class MicrosoftGraphAuthenticator {
2729 throw MicrosoftGraphAuthenticatorError . missingAccountIdentifier
2830 }
2931 return MicrosoftGraphCredential ( identifier: identifier, scopes: scopes)
32+ } . recover { error -> MicrosoftGraphCredential in
33+ if let error = error as NSError ? , error. domain == MSALErrorDomain {
34+ if error. code == MSALError . serverDeclinedScopes. rawValue {
35+ throw MicrosoftGraphAuthenticatorError . serverDeclinedScopes
36+ } else if error. code == MSALError . userCanceled. rawValue {
37+ throw MicrosoftGraphAuthenticatorError . userCanceled
38+ }
39+ }
40+ throw error
3041 }
3142 }
3243
You can’t perform that action at this time.
0 commit comments