diff --git a/backend/server/utils/google-oauth.ts b/backend/server/utils/google-oauth.ts index 21e2fb7..e0f5d7a 100644 --- a/backend/server/utils/google-oauth.ts +++ b/backend/server/utils/google-oauth.ts @@ -34,11 +34,20 @@ export const GOOGLE_OAUTH_SCOPES = [ ].join(" "); /** - * Redirect-URI: identisch zu MS (gleiche Deep-Link-Route in der App). - * Muss in der Google Cloud Console unter "Authorised redirect URIs" registriert sein. - * Android: als Custom URI Scheme (nicht als Android App Link, PKCE-Flow). + * Redirect-URI für Google iOS-OAuth-Client. + * + * Google verlangt für iOS-Client-Type eines von zwei Formaten: + * a) Reverse-Client-ID: `com.googleusercontent.apps.:/oauth2redirect` (gewählt) + * b) Bundle-ID: `org.rebreak.app:/oauth2redirect` + * + * Custom-Schemes wie `rebreak://...` (Microsoft-Pattern) werden mit + * `invalid_request — doesn't comply with OAuth 2.0 policy` rejected. + * Empirisch verifiziert 2026-05-28. + * + * iOS-App muss diesen URL-Scheme in CFBundleURLTypes registrieren. */ -export const GOOGLE_REDIRECT_URI = "rebreak://auth/mail-oauth-callback"; +export const GOOGLE_REDIRECT_URI = + "com.googleusercontent.apps.864178840836-rerbjn5pl31ocd83b2qqpbc8gs2o8ego:/oauth2redirect"; // ── PKCE Helpers ────────────────────────────────────────────────────────────── // Identisch zu ms-oauth.ts — ausgelagert weil beide Provider PKCE S256 nutzen.