Enhance OAuth flow by updating redirect handling in OAuthController and improving login process in OAuthCallback. Adjust Profile view to notify users upon successful Google account linking. Update mobile app to reflect changes in OAuth identity management with updated data types. This improves user experience and feedback during the OAuth process.

This commit is contained in:
Torsten Schulz (local)
2026-05-15 09:11:43 +02:00
parent 52719d5625
commit 58dd657ac1
4 changed files with 22 additions and 8 deletions

View File

@@ -76,7 +76,14 @@ class OAuthController {
return res.redirect(`${target}?${params.toString()}`);
}
return res.redirect(`${target}?token=${encodeURIComponent(authResult.token)}`);
const params = new URLSearchParams({
token: authResult.token
});
if (state.mode === 'link') {
params.set('linked', result.provider);
}
return res.redirect(`${target}?${params.toString()}`);
} catch (callbackError) {
console.error('Google OAuth Callback-Verarbeitung fehlgeschlagen:', callbackError);
return res.redirect(`${process.env.FRONTEND_URL || 'http://localhost:5010'}/login?error=oauth_failed`);
@@ -169,4 +176,3 @@ class OAuthController {
module.exports = new OAuthController();