File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,19 +36,17 @@ enum SocialLoginError: Error {
3636
3737extension Error {
3838 var isSocialLoginCancelled : Bool {
39+ switch self {
3940 // Apple 로그인 취소
40- if let authorizationError = self as? ASAuthorizationError {
41- return authorizationError. code == . canceled
42- }
43-
41+ case let authError as ASAuthorizationError :
42+ return authError. code == . canceled
4443 // Github 로그인 취소
45- if let webAuthenticationSessionError = self as? ASWebAuthenticationSessionError {
46- return webAuthenticationSessionError. code == . canceledLogin
44+ case let webAuthError as ASWebAuthenticationSessionError :
45+ return webAuthError. code == . canceledLogin
46+ default :
47+ let nsError = self as NSError
48+ // Google 로그인 취소
49+ return nsError. domain == kGIDSignInErrorDomain && nsError. code == GIDSignInError . canceled. rawValue
4750 }
48-
49- let error = self as NSError
50- // Google 로그인 취소
51- return error. domain == kGIDSignInErrorDomain
52- && error. code == GIDSignInError . canceled. rawValue
5351 }
5452}
You can’t perform that action at this time.
0 commit comments