private IRestRequest CompleteRegRequest(GuestCompletionParam guestRegistrationParam) { var request = Backtory.RestRequest("auth/guest-users/complete-registration", Method.POST); request.AddHeader(Backtory.AuthInstanceIdString, BacktoryConfig.BacktoryAuthInstanceId); request.AddHeader(KeyAuthorization, AuthorizationHeader()); request.AddJsonBody(guestRegistrationParam); return(request); }
public BacktoryResponse <BacktoryUser> CompleteRegistration(GuestCompletionParam guestRegistrationParam) { var completeRegResponse = Backtory.Execute <BacktoryUser>(CompleteRegRequest(guestRegistrationParam)); if (completeRegResponse.Successful) { DispatchSaveCurrentUser(completeRegResponse.Body); } return(completeRegResponse); }
public void CompleteRegistrationInBackgrond(GuestCompletionParam guestRegistrationParam, Action <BacktoryResponse <BacktoryUser> > callback) { Backtory.ExecuteAsync <BacktoryUser>(CompleteRegRequest(guestRegistrationParam), completeRegResponse => { if (completeRegResponse.Successful) { SaveAsCurrentUserInMemoryAndStorage(completeRegResponse.Body); } callback(completeRegResponse); }); }