Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Login with Google returns user to step 1 again during the donation process. #1260

Closed
kabaivanov opened this issue Dec 17, 2022 · 3 comments · Fixed by #1533
Closed
Assignees
Labels
template: bug type: bug Something isn't working

Comments

@kabaivanov
Copy link
Contributor

kabaivanov commented Dec 17, 2022

Which area(s) of Podkrepi.bg are affected?

Donation

Describe the Bug

When I initiate a donation before being logged:

  1. I input the donation amount. (step 1)
  2. I login via Google
  3. I have to input the donation amount again (step 1)

To Reproduce

  1. Initiate a donation without being logged in
  2. Login via Google

Expected Behavior

When I initiate a donation before being logged in:

  1. I input the donation amount. (step 1)
  2. I login via Google
  3. Step 2

Which browser are you using? (if relevant)

Safari Version 15.5

@kabaivanov kabaivanov added template: bug type: bug Something isn't working labels Dec 17, 2022
@momchiii
Copy link

momchiii commented Jan 5, 2023

I think that this is happening because the google login is refreshing the page. The refresh creates a brand new stepsContext with the initial values. The first thing that comes to my mind is to store the step in localStorage. You can assign the task to me. I'll also try to think of another way to fix this.

@kachar
Copy link
Member

kachar commented Jan 6, 2023

@momchiii Thanks for the investigation!

We're currently in the process of restructuring the donation flow, so it's gonna be great to make the update of the context to use localStorage to be created with reusability in mind.

@dimitur2204
Copy link
Contributor

dimitur2204 commented Jan 20, 2023

@momchiii I found some good info on how we can do it in a more abstracted approach
Take a look at this article: https://frankmeszaros.medium.com/use-localstorage-and-formik-to-supercharge-your-form-experience-a175d68e5ecb

This is kind of a do it yourself approach.

I also found this: https://github.com/kolengri/formik-persist-values, which if it works and is maintained might be a solution.

That will leave the steps context to handle by ourselves, but that could be something we put inside of the formik state

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment