Nessuna descrizione
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

AppleErrorExtensions.cs 589B

1234567891011121314151617181920
  1. using AppleAuth.Enums;
  2. using AppleAuth.Interfaces;
  3. using System;
  4. namespace AppleAuth.Extensions
  5. {
  6. public static class AppleErrorExtensions
  7. {
  8. public static AuthorizationErrorCode GetAuthorizationErrorCode(this IAppleError error)
  9. {
  10. if (error.Domain == "com.apple.AuthenticationServices.AuthorizationError" &&
  11. Enum.IsDefined(typeof(AuthorizationErrorCode), error.Code))
  12. {
  13. return (AuthorizationErrorCode)error.Code;
  14. }
  15. return AuthorizationErrorCode.Unknown;
  16. }
  17. }
  18. }