Skip to content

Commit

Permalink
Support transferred credential state
Browse files Browse the repository at this point in the history
Relates to #311, #454
  • Loading branch information
tp committed Dec 12, 2024
1 parent 3721987 commit 75a900b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ public class SignInWithAppleAvailablePlugin: NSObject, FlutterPlugin {
result("revoked")
case .notFound:
result("notFound")
case .transferred:
result("transferred")

default:
result(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ enum CredentialState {

/// The user wasn't found.
notFound,

/// The user was transferred to a different team
transferred,
}

extension CredentialStateApproved on CredentialState {
bool get isApproved {
return this == CredentialState.authorized ||
this == CredentialState.transferred;
}
}

/// Parses the string represenation of a [CredentialState] to its enum value.
Expand All @@ -34,6 +44,9 @@ CredentialState parseCredentialState(String? credentialState) {
case 'notFound':
return CredentialState.notFound;

case 'transferred':
return CredentialState.transferred;

default:
throw PlatformException(
code: 'unsupported-value',
Expand Down

0 comments on commit 75a900b

Please sign in to comment.