Skip to content

Fix: Auto-login after signup and redirect to dashboard#96

Merged
AneeshAhuja31 merged 2 commits intoDevasy:mainfrom
AneeshAhuja31:poc/streamlit-auth
Jul 30, 2025
Merged

Fix: Auto-login after signup and redirect to dashboard#96
AneeshAhuja31 merged 2 commits intoDevasy:mainfrom
AneeshAhuja31:poc/streamlit-auth

Conversation

@AneeshAhuja31
Copy link
Collaborator

@AneeshAhuja31 AneeshAhuja31 commented Jul 30, 2025

This PR improves the authentication flow by allowing users to be automatically logged in immediately after signing up. Upon successful registration, the user is redirected directly to the main dashboard in Home.py, removing the need for a separate login step.

Closes #95

Summary by CodeRabbit

  • New Features
    • Users are now automatically logged in immediately after a successful signup, providing a seamless transition to the main dashboard.
    • Clear success or error messages are displayed based on the outcome of the automatic login attempt.

@AneeshAhuja31 AneeshAhuja31 requested a review from Devasy as a code owner July 30, 2025 15:36
@netlify
Copy link

netlify bot commented Jul 30, 2025

Deploy Preview for splitwizer failed. Why did it fail? →

Name Link
🔨 Latest commit ff00d19
🔍 Latest deploy log https://app.netlify.com/projects/splitwizer/deploys/688a3c16ba398f00082e4fcc

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 30, 2025

Walkthrough

The change updates the signup logic so that after a user successfully signs up, the system immediately attempts to log them in using their new credentials. If the login is successful, the user is redirected to the main dashboard without needing to log in manually. Error handling for failed auto-login is also added.

Changes

Cohort / File(s) Change Summary
Signup Auto-Login Logic
ui-poc/Home.py
Modified signup form logic to attempt automatic login after successful signup, with appropriate messaging and error handling.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant SignupForm
    participant AuthSystem
    participant App

    User->>SignupForm: Submit signup form
    SignupForm->>AuthSystem: Attempt signup
    AuthSystem-->>SignupForm: Signup success
    SignupForm->>AuthSystem: Attempt login with new credentials
    AuthSystem-->>SignupForm: Login success
    SignupForm->>App: Rerun app (redirect to dashboard)
    Note over App,User: User is now logged in and redirected

    alt Login fails
        AuthSystem-->>SignupForm: Login failure
        SignupForm->>User: Show error (signup succeeded, login failed)
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~7 minutes

Assessment against linked issues

Objective Addressed Explanation
Auto-login user after successful signup to improve UX (#95)
Redirect to main dashboard after signup, without requiring extra login (#95)

Poem

A bunny hops with joy anew,
Signup now logs you in—woohoo!
No extra clicks, no waiting in line,
Straight to the dashboard—how divine!
With every hop, the UX grows bright,
Happy coding, day and night! 🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ca38e84 and ff00d19.

📒 Files selected for processing (1)
  • ui-poc/Home.py (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
ui-poc/Home.py

📄 CodeRabbit Inference Engine (.github/copilot-instructions.md)

ui-poc/Home.py: Frontend POC must be implemented using Streamlit, with the entry point in ui-poc/Home.py.
Streamlit session state must be used to manage user sessions in the frontend, as shown in Home.py.

Files:

  • ui-poc/Home.py
🧠 Learnings (1)
ui-poc/Home.py (1)

Learnt from: CR
PR: Devasy23/splitwiser#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-26T09:41:01.332Z
Learning: Applies to ui-poc/Home.py : Streamlit session state must be used to manage user sessions in the frontend, as shown in Home.py.

🔇 Additional comments (1)
ui-poc/Home.py (1)

182-190: LGTM! Auto-login implementation looks solid.

The automatic login after successful signup is well-implemented:

  • Reuses the existing login() function for consistency
  • Provides clear user feedback for both success and failure scenarios
  • Correctly uses st.rerun() to redirect to the dashboard
  • Handles the edge case where signup succeeds but login fails with appropriate error messaging
  • Maintains proper session state management as required by the coding guidelines

This change successfully addresses the PR objective of streamlining the user experience by eliminating the redundant login step after signup.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Owner

@Devasy Devasy left a comment

Choose a reason for hiding this comment

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

Why was this required, Can send ss of the bug behavior it's trying to fix

@AneeshAhuja31 AneeshAhuja31 self-assigned this Jul 30, 2025
@Devasy
Copy link
Owner

Devasy commented Jul 30, 2025

@AneeshAhuja31, please add necessary tags before merging this PR.

I;m approving this

Copy link
Owner

@Devasy Devasy left a comment

Choose a reason for hiding this comment

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

LGTM

@AneeshAhuja31 AneeshAhuja31 merged commit e3fff9a into Devasy:main Jul 30, 2025
35 of 41 checks passed
@AneeshAhuja31 AneeshAhuja31 deleted the poc/streamlit-auth branch August 2, 2025 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[GSSoC25] Fix redirect to main dashboard on signup, such that no extra login is required and improve ux

2 participants