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

feat: /account/login?redirect_to=/final/url should redirect to /final/url after authn #1950

Merged
merged 7 commits into from Sep 29, 2022

Conversation

gobengo
Copy link
Contributor

@gobengo gobengo commented Sep 26, 2022

Motivation:

  • Current if you're logged out, then try to access a page that requires auth like /account/payments, you'll be redirected through the authentication process and end up at /account (not the destination you originally wanted, always /account)

What this does

  • /account/login?redirect_to=/final/url should redirect to /final/url after authn
  • /account/payment page getStaticProps redirectTo redirects to /account/login?redirect_uri=/account/payment so the /pricing page can link to /account/payment

@github-actions
Copy link
Contributor

github-actions bot commented Sep 26, 2022

@gobengo gobengo marked this pull request as ready for review September 26, 2022 13:24
@@ -193,7 +193,7 @@ export function getStaticProps() {
props: {
title: 'Payment',
isRestricted: true,
redirectTo: '/login/',
redirectTo: '/login/?redirect_uri=/account/payment',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should just be /account/payment

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

redirectTo is where the http response will redirect to when the end-user isn't authenticated. This page is served at /account/payment. If redirect_to=/account/payment, it would be an infinite redirect.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok, I misunderstood what was happening there.

Copy link
Contributor

@drewdelano drewdelano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM -- redirectTo works a lot differently than i was expecting 😲

@gobengo gobengo merged commit 2bbe6de into main Sep 29, 2022
@gobengo gobengo deleted the 1663815219-login-redirect branch September 29, 2022 13:02
drewdelano pushed a commit that referenced this pull request Sep 29, 2022
🤖 I have created a release *beep* *boop*
---


##
[2.22.0](website-v2.21.2...website-v2.22.0)
(2022-09-29)


### Features

* /account/login?redirect_to=/final/url should redirect to /final/url
after authn
([#1950](#1950))
([2bbe6de](2bbe6de))
* create page for service level agreement
([#1955](#1955))
([6525845](6525845))
* early adopter UI
([#1959](#1959))
([1affae3](1affae3))
* homepage (index) copy for pricing changes
([#1942](#1942))
([f2084a3](f2084a3))
* new users are initialized into free tier
([#1945](#1945))
([ee67c35](ee67c35))
* pricing page (for tiered pricing)
([#1894](#1894))
([3f0db86](3f0db86))
* revert "fix: rm menu item from global account menu"
([#1951](#1951))
([2f84754](2f84754))
* update preview summary metadata
([#1965](#1965))
([a47949c](a47949c))
* update terms of service
([#1964](#1964))
([dd810b9](dd810b9))
* update the web3storage product page (for tiered pricing)
([#1957](#1957))
([03a6422](03a6422))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

None yet

2 participants