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:
@@ -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();
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user