mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 20:21:09 +02:00
🐛 fix(auth): implement password reset email link handler
- Add GET /api/auth/reset-password/:token endpoint to handle email links - Create password-reset-redirect store to track source app URLs - Include callbackURL in reset emails for proper app redirection - Add redirectTo parameter to forgotPassword in shared-auth - Create /reset-password page in calendar app with DE/EN translations - Update calendar authStore with resetPasswordWithToken method Fixes 404 error when clicking password reset link from email
This commit is contained in:
parent
2c341b5328
commit
111fc473d9
7 changed files with 427 additions and 5 deletions
|
|
@ -181,13 +181,15 @@ export function createAuthService(config: AuthServiceConfig) {
|
|||
|
||||
/**
|
||||
* Send password reset email
|
||||
* @param email - User's email address
|
||||
* @param redirectTo - Optional URL to redirect after password reset (current app origin)
|
||||
*/
|
||||
async forgotPassword(email: string): Promise<AuthResult> {
|
||||
async forgotPassword(email: string, redirectTo?: string): Promise<AuthResult> {
|
||||
try {
|
||||
const response = await fetch(`${baseUrl}${endpoints.forgotPassword}`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ email }),
|
||||
body: JSON.stringify({ email, redirectTo }),
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue