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

Persisting booking request details across authentication #844

Closed
ollieh-m opened this issue May 22, 2018 · 4 comments
Closed

Persisting booking request details across authentication #844

ollieh-m opened this issue May 22, 2018 · 4 comments

Comments

@ollieh-m
Copy link

Currently, if you start a booking without being signed in, the booking request details are not persisted for when you are eventually redirected to the checkout page. This means you have to sign in then fill in the booking form again.

The reason is this line: const hasNavigatedThroughLink = history.action === 'PUSH'
It returns false when the authentication redirects to the checkout page.

I've fixed it on our fork with const hasNavigatedThroughLink = history.action === 'PUSH' || history.action === 'REPLACE' instead.

I'd be interested if there's a better fix!

@Gnito
Copy link
Contributor

Gnito commented May 24, 2018

Thank you for reporting this. We have not thought enough about replace action, it seems.

Your suggestion is a good solution for now, but I was starting to think if we could avoid that variable altogether.

That ”hasNavigatedThroughLink” is added to prevent user from navigating back (and making duplicate booking) after successful order. I haven’t tested this, but maybe the same thing could be achieved better by using history.replace instead of history.push in handleSubmit method.

@pcm211
Copy link

pcm211 commented May 24, 2018

i need an api key

@kpuputti
Copy link
Contributor

Hi @pcm211 ! Thanks for your interest in Sharetribe Flex!

Sharetribe Flex is currently in Closed Preview mode. This means that we are currently unable to open the access to everyone. We will be handing out API keys slowly to more and more people.

In order to get your API key, I'd suggest you to Request early access, keeping in mind that you may need to wait some time to get the API key, or you may be even rejected from the early access. This is unfortunate, but as mentioned, we are not yet able to open Flex to everyone who is interested.

@Gnito
Copy link
Contributor

Gnito commented Jun 25, 2018

Now that I finally had time to look this a bit more, I have to say that my idea of playing with history.replace didn't sound good. That would require strange logic in all the places where we need a user to be authenticated (checkout & create new listing).

So, for now, I ended up making suggested changes to CheckoutPage.js. See #852

If there's more demand for this kind of prevent-back-navigation, bigger changes could be done so that RouteConfiguration.js and Routes.js can handle flags like "preventBackNavigation: true".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants