Skip to content

Redirect to signup page on deploy if not logged in #7471

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

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

lovincyrus
Copy link
Contributor

@lovincyrus lovincyrus commented Jun 17, 2025

Closes https://linear.app/rilldata/issue/APP-28/make-sure-that-sign-up-is-the-default-auth0-universal-login-page-when

This pull request modifies the authentication flow to automatically redirect to /auth/signup instead of the /auth or /auth/login. One downside is that if localhost:8080 isn't up, the local auth0 server won't be redirected to the sign up page.

  1. User clicks "Deploy" → http://localhost:8080/auth/signup?redirect=http://localhost:9009/deploy
  2. Admin server saves redirect URL in cookie during authStart
  3. User authenticates with Auth0 → signup/login flow
  4. Admin server retrieves redirect URL from cookie in authLoginCallback
  5. Admin server sets auth token in cookie via authWithToken
  6. Admin server redirects user back to http://localhost:9009/deploy

Reviewers, to test this locally

$ make cli
$ ./rill start dev-project

# make sure ./rill devtool start cloud is running on a separate terminal
$ ./rill devtool start cloud
CleanShot.2025-06-17.at.13.25.27.mp4

Checklist:

  • Covered by tests
  • Ran it and it works as intended
  • Reviewed the diff before requesting a review
  • Checked for unhandled edge cases
  • Linked the issues it closes
  • Checked if the docs need to be updated. If so, create a separate Linear DOCS issue
  • Intend to cherry-pick into the release branch
  • I'm proud of this work!

@lovincyrus lovincyrus self-assigned this Jun 17, 2025
@lovincyrus lovincyrus requested a review from djbarnwal June 18, 2025 16:30
@lovincyrus lovincyrus marked this pull request as ready for review June 18, 2025 16:30
deployCTAUrl = `${$metadata.data.loginUrl}?redirect=${deployPageUrl}`;
// For first-time users, redirect to signup flow
// Use admin server's signup endpoint (/auth/signup) for proper signup experience
deployCTAUrl = `${$metadata.data.adminUrl}/auth/signup?redirect=${deployPageUrl}`;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Curious for everyone's thoughts on this - I've appended /signup with adminUrl to this line here when user isn't logged in. Eric O and Mike requested that we land users on the sign-up page in the Rill Developer when they deploy the project.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I could turn it into a condition statement to only apply adminUrl with /signup in the cloud environments and remain using loginUrl in the dev environment.

Copy link
Collaborator

@AdityaHegde AdityaHegde Jun 19, 2025

Choose a reason for hiding this comment

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

Login doesn't actually work during deploy. Logout from everything, cli and browser, clicking deploy doesnt really redirect back with login status after logging in.

The local server needs to be hit before the admin endpoint. It needs to get the callback 1st to actually get the token as well. loginUrl has the local endpoint here, so we cant just use adminUrl . Check the handler for more info: https://github.com/rilldata/rill/blob/main/cli/pkg/local/server.go#L768

@k-anshul Any quick path here?

@ericpgreen2 ericpgreen2 requested a review from ericokuma June 18, 2025 16:52
@ericokuma
Copy link
Contributor

So if i understand this correctly, we will re-direct all non-logged-in users to the signup page during the deploy journey regardless of whether they are first time users or returning users right?

I think that's okay for now. According to the team, most returning users will be logged in so they won't even see the Auth0 page.

In the near future, it might be good to build that intermediary page with both login and signup options

Copy link
Contributor

@ericokuma ericokuma left a comment

Choose a reason for hiding this comment

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

lgtm

@lovincyrus
Copy link
Contributor Author

So if i understand this correctly, we will re-direct all non-logged-in users to the signup page during the deploy journey regardless of whether they are first time users or returning users right?

Yes!

I think that's okay for now. According to the team, most returning users will be logged in so they won't even see the Auth0 page.

In the near future, it might be good to build that intermediary page with both login and signup options

Okay!

Copy link
Collaborator

@AdityaHegde AdityaHegde left a comment

Choose a reason for hiding this comment

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

Check my other comment. This breaks login flow during deploy for existing users.

@lovincyrus lovincyrus marked this pull request as draft June 20, 2025 15:51
@@ -53,7 +53,8 @@
$: deployPageUrl = `${$page.url.protocol}//${$page.url.host}/deploy`;

$: if (userNotLoggedIn && $metadata.data) {
deployCTAUrl = `${$metadata.data.loginUrl}?redirect=${deployPageUrl}`;
// FIXME: implement signupUrl
deployCTAUrl = `${$metadata.data.signupUrl}?redirect=${deployPageUrl}`;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm curious if we could use a $metadata.data.signupUrl here

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.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy