handleSuccess method
Implementation
void handleSuccess(AuthResponseSuccess message, void Function()? onSuccess) {
var delegations = message.delegations.map((signedDelegation) {
return SignedDelegation.fromMap({
"delegation": Delegation(
signedDelegation.delegation.pubkey,
signedDelegation.delegation.expiration,
signedDelegation.delegation.targets,
),
"signature": signedDelegation.signature,
});
}).toList();
final delegationChain = DelegationChain.fromDelegations(
delegations,
message.userPublicKey,
);
if (key == null) {
return;
}
chain = delegationChain;
identity = DelegationIdentity.fromDelegation(key!, chain!);
onSuccess?.call();
}