Skip to content

Conversation

@gerardopar
Copy link
Collaborator

@gerardopar gerardopar commented Dec 15, 2025

Overview

🎟 Relevant Jira Issues

📚 What is the context and goal of this PR?

Issue: On mobile, after logging out in the LearnCard App,
the account modal remains open instead of closing automatically.

  1. Close all opened modals on logout()
  2. Potentially fix the hard refresh on logout
    • stop redirect from within useWeb3AuthSFA() -> window.location.href = redirectUrl;
    • handle redirect from within LCA instead history.push(redirectUrl)

🥴 TL; RL:

💡 Feature Breakdown (screenshots & videos encouraged!)

https://www.loom.com/share/f996736fdbdc49148267785415d0329b

🛠 Important tradeoffs made:

🔍 Types of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Chore (refactor, documentation update, etc)

💳 Does This Create Any New Technical Debt? ( If yes, please describe and add JIRA TODOs )

  • No
  • Yes

Testing

🔬 How Can Someone QA This?

Confirm logout works as expected

  1. login / logout multiple times (IOS, Android & Web )
  2. confirm no modals are open on logout
  3. confirm no hard refresh happens on logout

📱 🖥 Which devices would you like help testing on?

🧪 Code Coverage

Documentation

📜 Gitbook

📊 Storybook

✅ PR Checklist

  • Related to a Jira issue (create one if not)
  • My code follows style guidelines (eslint / prettier)
  • I have manually tested common end-2-end cases
  • I have reviewed my code
  • I have commented my code, particularly where ambiguous
  • New and existing unit tests pass locally with my changes
  • I have made corresponding changes to gitbook documentation

🚀 Ready to squash-and-merge?:

  • Code is backwards compatible
  • There is not a "Do Not Merge" label on this PR
  • I have thoughtfully considered the security implications of this change.
  • This change does not expose new public facing endpoints that do not have authentication

✨ PR Description

Purpose: Fix logout behavior to prevent redirect issues and ensure proper modal closure by handling navigation within the application instead of delegating to Web3Auth.

Main changes:

  • Modified logout flow to close all modals before logout and handle redirect internally via React Router
  • Updated MyLearnCardModal logout button to override redirect URL to '/login' page
  • Changed useWeb3AuthSFA logout method signature to make redirectUrl optional parameter instead of required

Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using.
💡 Tip: You can customize your AI Description using Guidelines Learn how

@changeset-bot
Copy link

changeset-bot bot commented Dec 15, 2025

🦋 Changeset detected

Latest commit: 9bdaa1b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
learn-card-app Patch
learn-card-base Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@netlify
Copy link

netlify bot commented Dec 15, 2025

Deploy Preview for staging-learncardapp ready!

Name Link
🔨 Latest commit 9bdaa1b
🔍 Latest deploy log https://app.netlify.com/projects/staging-learncardapp/deploys/694062069e24210007536422
😎 Deploy Preview https://deploy-preview-880--staging-learncardapp.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Dec 15, 2025

Deploy Preview for learncarddocs canceled.

Name Link
🔨 Latest commit 9bdaa1b
🔍 Latest deploy log https://app.netlify.com/projects/learncarddocs/deploys/694062060d911e0008e9344b

@gerardopar gerardopar changed the title fix: Logout Behavior [LC-1467] - fix: Logout Behavior Dec 15, 2025
@gitstream-cm
Copy link
Contributor

gitstream-cm bot commented Dec 15, 2025

This PR is missing a Jira ticket reference in the title or description.
Please add a Jira ticket reference to the title or description of this PR.

Copy link
Contributor

@gitstream-cm gitstream-cm bot left a comment

Choose a reason for hiding this comment

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

✨ PR Review

The PR successfully addresses the main issue by closing modals on logout and avoiding hard refreshes. However, there's a breaking change in the logout function signature that could affect other consumers.

1 issues detected:

🐞 Bug - Removing default parameter value creates a breaking change that could leave users without expected redirect behavior. 🛠️

Details: The logout function signature was changed from having a default redirectUrl parameter to making it optional. This removes the automatic redirect behavior that other parts of the codebase might rely on.
File: packages/learn-card-base/src/hooks/useWeb3AuthSFA.ts (215-215)
🛠️ A suggested code correction is included in the review comments.

Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using.
💡 Tip: You can customize your AI Review using Guidelines Learn how

@gitstream-cm
Copy link
Contributor

gitstream-cm bot commented Dec 15, 2025

This PR is missing a Jira ticket reference in the title or description.
Please add a Jira ticket reference to the title or description of this PR.

@gitstream-cm
Copy link
Contributor

gitstream-cm bot commented Dec 15, 2025

🥷 Code experts: TaylorBeeston

TaylorBeeston has most 👩‍💻 activity in the files.
TaylorBeeston has most 🧠 knowledge in the files.

See details

apps/learn-card-app/src/components/learncard/MyLearnCardModal.tsx

Activity based on git-commit:

TaylorBeeston
DEC 2 additions & 2 deletions
NOV 521 additions & 5 deletions
OCT
SEP
AUG
JUL

Knowledge based on git-blame:
TaylorBeeston: 100%

apps/learn-card-app/src/hooks/useLogout.tsx

Activity based on git-commit:

TaylorBeeston
DEC 6 additions & 7 deletions
NOV 104 additions & 3 deletions
OCT
SEP
AUG
JUL

Knowledge based on git-blame:
TaylorBeeston: 100%

packages/learn-card-base/src/hooks/useWeb3AuthSFA.ts

Activity based on git-commit:

TaylorBeeston
DEC
NOV 322 additions & 1 deletions
OCT
SEP
AUG
JUL

Knowledge based on git-blame:
TaylorBeeston: 100%

✨ Comment /gs review for LinearB AI review. Learn how to automate it here.

Copy link
Contributor

@gitstream-cm gitstream-cm bot left a comment

Choose a reason for hiding this comment

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

✨ PR Review

LGTM

Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using.
💡 Tip: You can customize your AI Review using Guidelines Learn how

Copy link
Collaborator

@goblincore goblincore left a comment

Choose a reason for hiding this comment

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

@gerardopar LGTM!

@gerardopar gerardopar merged commit 1e25b1c into main Dec 16, 2025
28 checks passed
@gerardopar gerardopar deleted the lc-1467 branch December 16, 2025 00:57
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.

3 participants