feat(auth): add resend verification email to all login pages

Add ability to resend verification email when login fails with
"Email not verified" error. Implemented across all 14 apps using
Mana Core Auth.

Changes:
- Add POST /api/v1/auth/resend-verification endpoint to mana-core-auth
- Add resendVerificationEmail method to shared-auth client
- Update LoginPage component with resend UI and translations
- Add resendVerificationEmail to all app auth stores
- Add translations for de, en, fr, es, it
- Add PlantaLogo to shared-branding
- Migrate planta login to shared LoginPage component
This commit is contained in:
Till-JS 2026-01-29 14:55:49 +01:00
parent f911243bf0
commit 0c150df0f1
45 changed files with 691 additions and 110 deletions

View file

@ -40,6 +40,7 @@ const DEFAULT_ENDPOINTS: AuthEndpoints = {
validate: '/api/v1/auth/validate',
forgotPassword: '/api/v1/auth/forgot-password',
resetPassword: '/api/v1/auth/reset-password',
resendVerification: '/api/v1/auth/resend-verification',
googleSignIn: '/api/v1/auth/google-signin',
appleSignIn: '/api/v1/auth/apple-signin',
credits: '/api/v1/credits/balance',
@ -247,6 +248,37 @@ export function createAuthService(config: AuthServiceConfig) {
}
},
/**
* Resend verification email
* @param email - User's email address
* @param sourceAppUrl - Optional URL to redirect after verification (current app origin)
*/
async resendVerificationEmail(email: string, sourceAppUrl?: string): Promise<AuthResult> {
try {
const response = await fetch(`${baseUrl}${endpoints.resendVerification}`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ email, sourceAppUrl }),
});
if (!response.ok) {
const errorData = await response.json();
return {
success: false,
error: errorData.message || 'Failed to resend verification email',
};
}
return { success: true };
} catch (error) {
console.error('Error resending verification email:', error);
return {
success: false,
error: error instanceof Error ? error.message : 'Unknown error',
};
}
},
/**
* Refresh the authentication tokens
*/

View file

@ -129,6 +129,7 @@ export interface AuthEndpoints {
validate: string;
forgotPassword: string;
resetPassword: string;
resendVerification: string;
googleSignIn: string;
appleSignIn: string;
credits: string;