stack/packages
Naresh Kumar 0564d7d81a
Some checks failed
all-good: Did all the other checks pass? / all-good (push) Has been cancelled
Ensure Prisma migrations are in sync with the schema / check_prisma_migrations (22.x) (push) Has been cancelled
Docker Emulator Test / docker (push) Has been cancelled
Docker Server Build and Push / Docker Build and Push Server (push) Has been cancelled
Docker Server Test / docker (push) Has been cancelled
Runs E2E API Tests / build (22.x) (push) Has been cancelled
Lint & build / lint_and_build (latest) (push) Has been cancelled
Preview Docs / run (push) Has been cancelled
Dev Environment Test / restart-dev-and-test (push) Has been cancelled
Run setup tests / setup-tests (push) Has been cancelled
TOC Generator / TOC Generator (push) Has been cancelled
Fix/disable forgot password when auth disabled (#562)
This PR addresses the issue where the /handler/forgot-password page
should not be accessible when password authentication is disabled.
Additionally, it improves the redirection behavior when a user is
already logged in.

### Changes:

Added a redirection check in the useEffect hook to ensure that logged-in
users are redirected to the appropriate page instead of staying on the
forgot-password page.

### Fixes:
Closes #292

### Test:
[Screencast from 2025-03-20
22-18-36.webm](https://github.com/user-attachments/assets/d626ba95-9d7f-46e6-b232-0320b171d130)

<!-- ELLIPSIS_HIDDEN -->

----

> [!IMPORTANT]
> Redirects logged-in users from `ForgotPassword` page and prevents
access when password authentication is disabled.
> 
>   - **Behavior**:
> - Redirects logged-in users from `ForgotPassword` page using
`useEffect` in `forgot-password.tsx`.
> - Prevents access to `ForgotPassword` when password authentication is
disabled.
>   - **Functions**:
>     - Adds `useEffect` hook in `ForgotPassword` to handle redirection.
>   - **Fixes**:
>     - Closes issue #292.
> 
> <sup>This description was created by </sup>[<img alt="Ellipsis"
src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=stack-auth%2Fstack-auth&utm_source=github&utm_medium=referral)<sup>
for 9c93cb4078. It will automatically
update as commits are pushed.</sup>

<!-- ELLIPSIS_HIDDEN -->

---------

Co-authored-by: Zai Shi <zaishi00@outlook.com>
2025-04-24 03:19:40 +02:00
..
init-stack chore: update package versions 2025-04-23 09:31:26 -07:00
js chore: update package versions 2025-04-23 09:31:26 -07:00
react chore: update package versions 2025-04-23 09:31:26 -07:00
stack chore: update package versions 2025-04-23 09:31:26 -07:00
stack-emails chore: update package versions 2025-04-23 09:31:26 -07:00
stack-sc chore: update package versions 2025-04-23 09:31:26 -07:00
stack-shared chore: update package versions 2025-04-23 09:31:26 -07:00
stack-ui chore: update package versions 2025-04-23 09:31:26 -07:00
template Fix/disable forgot password when auth disabled (#562) 2025-04-24 03:19:40 +02:00