🐛 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:
Till-JS 2026-01-28 15:49:33 +01:00
parent 2c341b5328
commit 111fc473d9
7 changed files with 427 additions and 5 deletions

View file

@ -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) {