jsgoupil / quickbooks-sync

Sync Quickbooks Desktop
MIT License
87 stars 40 forks source link

Authenticator Null Reference #70

Closed jmawebtech closed 1 year ago

jmawebtech commented 1 year ago

Hi,

I am in QbManager > AuthenticateAsync.

I receive a null reference here on line 82:

quickbooks-sync\test\WebApplication.Sample\Application\Authenticator.cs

How is your code getting the current step? I just passed the

image

jsgoupil commented 1 year ago

I would probably have to see the callstack, but the CurrentStep is set https://github.com/jsgoupil/quickbooks-sync/blob/master/src/WebConnector.AspNetCore/QbManager.cs#L175

The first time this run, the step will be null. This is handled here. https://github.com/jsgoupil/quickbooks-sync/blob/master/src/WebConnector.AspNetCore/QbManager.cs#L557-L560

If the Step is null all the time, maybe you didn't register any steps?

jmawebtech commented 1 year ago

In your Authenticator class, you must return a step:

return new QbTicket { Authenticated = true, Ticket = guid, CurrentStep = "ItemQuery", // We store more information about the ticket, such as the user. // Check the extension to learn how to reach for this user. User = user, UserId = user.Id };

jsgoupil commented 1 year ago

The CurrentStep is not controlled by the user, it's controlled by the package. You just have to save it and return it as is.

OleksiiSydorov commented 1 year ago

i have the same error. just downloaded the sample application.

jsgoupil commented 1 year ago

This is fixed in 3.1.3 Thanks for reporting @jmawebtech , @OleksiiSydorov