diff --git a/.env.development b/.env.development index 50a3e3f8e..a273535f4 100644 --- a/.env.development +++ b/.env.development @@ -70,28 +70,30 @@ STRIPE_PUBLISHABLE_KEY=pk_test_YOUR_KEY STRIPE_WEBHOOK_SECRET=whsec_103705b73101b783a91305a9ec272834df6a096ffb2c2566b1c899318a156b03 # Stripe Product & Price IDs (ManaCore Unified Plans - Live) -# Plus: 4.99€/month, 49.99€/year - 100 credits +# Plus: 1.00€/month, 9.60€/year - 100 credits (1 Mana = 1 Cent) STRIPE_PLUS_PRODUCT_ID=prod_TzNUGcq9qx9rRT -STRIPE_PLUS_PRICE_MONTHLY=price_1T1OkKAZjQCYS0ZJ88m0shoN -STRIPE_PLUS_PRICE_YEARLY=price_1T1OkLAZjQCYS0ZJ4IdMzVyJ +STRIPE_PLUS_PRICE_MONTHLY=price_1TEt04AZjQCYS0ZJUuUWt3yg +STRIPE_PLUS_PRICE_YEARLY=price_1TEt05AZjQCYS0ZJYPqiqQMm -# Pro: 11.99€/month, 119.99€/year - 500 credits +# Pro: 5.00€/month, 48.00€/year - 500 credits (1 Mana = 1 Cent) STRIPE_PRO_PRODUCT_ID=prod_TzNUgWeBjT35qn -STRIPE_PRO_PRICE_MONTHLY=price_1T1OkLAZjQCYS0ZJvyPM7Wop -STRIPE_PRO_PRICE_YEARLY=price_1T1OkLAZjQCYS0ZJDbZeuOOu +STRIPE_PRO_PRICE_MONTHLY=price_1TEt05AZjQCYS0ZJjmjsUdkJ +STRIPE_PRO_PRICE_YEARLY=price_1TEt05AZjQCYS0ZJtaT4UGsA -# Ultra: 24.99€/month, 249.99€/year - 2000 credits +# Ultra: 20.00€/month, 192.00€/year - 2000 credits (1 Mana = 1 Cent) STRIPE_ULTRA_PRODUCT_ID=prod_TzNUE5pTbTDdbp -STRIPE_ULTRA_PRICE_MONTHLY=price_1T1OkMAZjQCYS0ZJYCJNZtg8 -STRIPE_ULTRA_PRICE_YEARLY=price_1T1OkMAZjQCYS0ZJvCvR6Ve6 +STRIPE_ULTRA_PRICE_MONTHLY=price_1TEt06AZjQCYS0ZJdyTDjfUk +STRIPE_ULTRA_PRICE_YEARLY=price_1TEt06AZjQCYS0ZJ6Wq3gNpM -# Credit Packs (One-time purchases) -STRIPE_CREDITS_100_PRODUCT_ID=prod_TzNUvyjD4hrcUR -STRIPE_CREDITS_100_PRICE=price_1T1OkNAZjQCYS0ZJP6XQ33F7 -STRIPE_CREDITS_500_PRODUCT_ID=prod_TzNUzzub5HM70Q -STRIPE_CREDITS_500_PRICE=price_1T1OkNAZjQCYS0ZJGH9TKmqa -STRIPE_CREDITS_1000_PRODUCT_ID=prod_TzNUvB4LT4PCCe -STRIPE_CREDITS_1000_PRICE=price_1T1OkNAZjQCYS0ZJvc6HTfB5 +# Mana Tränke (One-time purchases, 1 Mana = 1.4 Cent) +STRIPE_POTION_SMALL_PRODUCT_ID=prod_UDKn8rXX0Crz0T +STRIPE_POTION_SMALL_PRICE=price_1TEu8UAZjQCYS0ZJUGnsu9SH +STRIPE_POTION_MEDIUM_PRODUCT_ID=prod_UDKnANMuSvWMIE +STRIPE_POTION_MEDIUM_PRICE=price_1TEu8UAZjQCYS0ZJQr2FbDm0 +STRIPE_POTION_LARGE_PRODUCT_ID=prod_UDKnTxFN6xD0ID +STRIPE_POTION_LARGE_PRICE=price_1TEu8VAZjQCYS0ZJDX6i2jwv +STRIPE_POTION_HUGE_PRODUCT_ID=prod_UDKncb3tyAlGKy +STRIPE_POTION_HUGE_PRICE=price_1TEu8VAZjQCYS0ZJ7AO86Jrt # Customer Portal Configuration STRIPE_PORTAL_CONFIG_ID=bpc_1T1PFdAZjQCYS0ZJEhF9ob7q @@ -191,10 +193,6 @@ PICTURE_STORAGE_PUBLIC_URL=http://localhost:9000/picture-storage PICTURE_APP_ID=picture-app PICTURE_MANA_CORE_SERVICE_KEY= -# OAuth (optional - leave empty to disable) -PICTURE_GOOGLE_CLIENT_ID= -PICTURE_APPLE_CLIENT_ID= - # ============================================ # NUTRIPHI PROJECT # ============================================ diff --git a/apps/calendar/apps/web/src/routes/(auth)/login/+page.svelte b/apps/calendar/apps/web/src/routes/(auth)/login/+page.svelte index 82ccc224c..dd053734c 100644 --- a/apps/calendar/apps/web/src/routes/(auth)/login/+page.svelte +++ b/apps/calendar/apps/web/src/routes/(auth)/login/+page.svelte @@ -57,8 +57,6 @@ onSignIn={handleSignIn} onResendVerification={handleResendVerification} {goto} - enableGoogle={false} - enableApple={false} successRedirect={redirectTo} registerPath="/register" forgotPasswordPath="/forgot-password" diff --git a/apps/chat/apps/web/src/routes/(auth)/login/+page.svelte b/apps/chat/apps/web/src/routes/(auth)/login/+page.svelte index 808e7ec26..014b76bf6 100644 --- a/apps/chat/apps/web/src/routes/(auth)/login/+page.svelte +++ b/apps/chat/apps/web/src/routes/(auth)/login/+page.svelte @@ -64,8 +64,6 @@ onSignIn={handleSignIn} onResendVerification={handleResendVerification} {goto} - enableGoogle={false} - enableApple={false} successRedirect={redirectTo} registerPath="/register" forgotPasswordPath="/forgot-password" diff --git a/apps/citycorners/apps/web/src/routes/(auth)/login/+page.svelte b/apps/citycorners/apps/web/src/routes/(auth)/login/+page.svelte index 3e63c25a4..aa9def267 100644 --- a/apps/citycorners/apps/web/src/routes/(auth)/login/+page.svelte +++ b/apps/citycorners/apps/web/src/routes/(auth)/login/+page.svelte @@ -48,8 +48,6 @@ onSignIn={handleSignIn} onResendVerification={handleResendVerification} {goto} - enableGoogle={false} - enableApple={false} successRedirect={redirectTo} registerPath="/register" forgotPasswordPath="/forgot-password" diff --git a/apps/clock/apps/web/src/routes/(auth)/login/+page.svelte b/apps/clock/apps/web/src/routes/(auth)/login/+page.svelte index 6ae8b40bf..0c7708aef 100644 --- a/apps/clock/apps/web/src/routes/(auth)/login/+page.svelte +++ b/apps/clock/apps/web/src/routes/(auth)/login/+page.svelte @@ -55,8 +55,6 @@ onSignIn={handleSignIn} onResendVerification={handleResendVerification} {goto} - enableGoogle={false} - enableApple={false} successRedirect={redirectTo} registerPath="/register" forgotPasswordPath="/forgot-password" diff --git a/apps/contacts/apps/web/src/routes/(auth)/login/+page.svelte b/apps/contacts/apps/web/src/routes/(auth)/login/+page.svelte index af14d7c36..04709eb29 100644 --- a/apps/contacts/apps/web/src/routes/(auth)/login/+page.svelte +++ b/apps/contacts/apps/web/src/routes/(auth)/login/+page.svelte @@ -54,8 +54,6 @@ onSignIn={handleSignIn} onResendVerification={handleResendVerification} {goto} - enableGoogle={false} - enableApple={false} successRedirect={redirectTo} registerPath="/register" forgotPasswordPath="/forgot-password" diff --git a/apps/context/apps/web/src/routes/(auth)/login/+page.svelte b/apps/context/apps/web/src/routes/(auth)/login/+page.svelte index 94445c52b..a1407c3fc 100644 --- a/apps/context/apps/web/src/routes/(auth)/login/+page.svelte +++ b/apps/context/apps/web/src/routes/(auth)/login/+page.svelte @@ -49,8 +49,6 @@ onSignIn={handleSignIn} onResendVerification={handleResendVerification} {goto} - enableGoogle={false} - enableApple={false} successRedirect={redirectTo} registerPath="/register" forgotPasswordPath="/forgot-password" diff --git a/apps/manacore/apps/web/src/routes/(auth)/login/+page.svelte b/apps/manacore/apps/web/src/routes/(auth)/login/+page.svelte index 85509b672..99f52c093 100644 --- a/apps/manacore/apps/web/src/routes/(auth)/login/+page.svelte +++ b/apps/manacore/apps/web/src/routes/(auth)/login/+page.svelte @@ -33,8 +33,6 @@ onSignIn={handleSignIn} onResendVerification={handleResendVerification} {goto} - enableGoogle={false} - enableApple={false} successRedirect="/dashboard" registerPath="/register" forgotPasswordPath="/forgot-password" diff --git a/apps/manadeck/apps/mobile/SOCIAL_AUTH_SETUP.md b/apps/manadeck/apps/mobile/SOCIAL_AUTH_SETUP.md deleted file mode 100644 index 21b7b8cf6..000000000 --- a/apps/manadeck/apps/mobile/SOCIAL_AUTH_SETUP.md +++ /dev/null @@ -1,522 +0,0 @@ -# Social Authentication Setup Guide for Manadeck - -This guide explains how to set up Google Sign-In and Apple Sign-In for the Manadeck mobile app. - -## Overview - -Manadeck uses Mana Core authentication middleware which supports: -- Email/Password authentication -- Google Sign-In (Android & iOS) -- Apple Sign-In (iOS only) - -All authentication methods issue JWT tokens that work with your Supabase backend and respect Row-Level Security (RLS) policies. - -## Prerequisites - -### Required Accounts and Credentials - -1. **Google Cloud Console Account** - - OAuth 2.0 credentials for Android and iOS - - Web Client ID (for Android) - - iOS Client ID (for iOS) - -2. **Apple Developer Account** - - Sign in with Apple capability enabled - - App ID configured with Sign in with Apple - -3. **Mana Core Backend** - - Backend must support `/v1/auth/google-signin` and `/v1/auth/apple-signin` endpoints - - Backend URL configured in `.env.local` - -## Installation - -The required dependencies are already installed: -- `@react-native-google-signin/google-signin@^14.0.1` -- `expo-apple-authentication@~8.0.7` -- `base64-js` - -## Configuration Steps - -### 1. Google Cloud Console Setup - -#### Create OAuth Credentials - -1. Go to [Google Cloud Console](https://console.cloud.google.com) -2. Create a new project or select existing project -3. Navigate to **APIs & Services → Credentials** - -#### For Android: -1. Click **Create Credentials → OAuth 2.0 Client ID** -2. Select **Android** as application type -3. Fill in: - - **Package name**: `com.tilljs.manadeck` - - **SHA-1 certificate fingerprint**: Get from `cd android && ./gradlew signingReport` -4. Click **Create** - -#### For iOS: -1. Click **Create Credentials → OAuth 2.0 Client ID** -2. Select **iOS** as application type -3. Fill in: - - **Bundle ID**: `com.tilljs.manadeck` -4. Click **Create** -5. **Save the iOS Client ID** (format: `XXXXX.apps.googleusercontent.com`) - -#### For Web (Required for Android): -1. Click **Create Credentials → OAuth 2.0 Client ID** -2. Select **Web application** as application type -3. Fill in: - - **Name**: Manadeck Web (for Android) -4. Click **Create** -5. **Save the Web Client ID** (format: `XXXXX.apps.googleusercontent.com`) - -### 2. Apple Developer Console Setup - -#### Enable Sign in with Apple - -1. Go to [Apple Developer Portal](https://developer.apple.com/account) -2. Navigate to **Certificates, Identifiers & Profiles** -3. Click **Identifiers** in the sidebar -4. Find and select your App ID: `com.tilljs.manadeck` -5. In the **Capabilities** section, find **Sign in with Apple** -6. Check the **Sign in with Apple** checkbox -7. Click **Save** - -#### Configure in Xcode (Optional but Recommended) - -1. Open your iOS project: - ```bash - cd /Users/tillschneider/Documents/__00__Code/manadeck/apps/mobile - open ios/manadeck.xcworkspace - ``` -2. Select your project target in the left sidebar -3. Go to **Signing & Capabilities** tab -4. Click **+ Capability** button -5. Add **Sign in with Apple** -6. Ensure proper signing team is selected (Team ID: QP3GLU8PH3) - -### 3. Update Environment Variables - -Edit `/Users/tillschneider/Documents/__00__Code/manadeck/apps/mobile/.env.local`: - -```bash -# Existing Supabase Configuration -EXPO_PUBLIC_SUPABASE_URL=https://vksoodohrbjwyloitvsz.supabase.co -EXPO_PUBLIC_SUPABASE_ANON_KEY=sb_publishable_2ndX-kBHFpbDlL_ZeeOnfQ_ZlLI8ONk - -# Existing Backend API Configuration -EXPO_PUBLIC_API_URL=https://manadeck-backend-pduya7fsoq-ey.a.run.app - -# Google OAuth Configuration (ADD THESE) -# Web Client ID (used for Android authentication) -EXPO_PUBLIC_GOOGLE_CLIENT_ID=YOUR_WEB_CLIENT_ID.apps.googleusercontent.com -# iOS Client ID (used for iOS authentication) -EXPO_PUBLIC_GOOGLE_IOS_CLIENT_ID=YOUR_IOS_CLIENT_ID.apps.googleusercontent.com -``` - -**Replace the placeholder values with your actual OAuth Client IDs from Google Cloud Console.** - -### 4. Update app.json - -The `app.json` has already been configured with: - -```json -{ - "expo": { - "ios": { - "config": { - "googleSignIn": { - "reservedClientId": "com.googleusercontent.apps.PLACEHOLDER_IOS_CLIENT_ID" - } - }, - "usesAppleSignIn": true - }, - "plugins": [ - "expo-router", - "@react-native-google-signin/google-signin", - "expo-apple-authentication" - ] - } -} -``` - -**Important**: Replace `PLACEHOLDER_IOS_CLIENT_ID` in `app.json` with your actual iOS Client ID (without the `com.googleusercontent.apps.` prefix). - -For example, if your iOS Client ID is `123456789-abc123.apps.googleusercontent.com`, the `reservedClientId` should be: -```json -"reservedClientId": "com.googleusercontent.apps.123456789-abc123" -``` - -### 5. Rebuild Native Code - -After updating `app.json` and environment variables, rebuild the native code: - -```bash -cd /Users/tillschneider/Documents/__00__Code/manadeck/apps/mobile - -# For iOS -npx expo prebuild --clean -npx expo run:ios - -# For Android -npx expo prebuild --clean -npx expo run:android -``` - -### 6. **IMPORTANT**: Manually Add iOS URL Scheme - -**⚠️ Critical Step**: The Expo plugin may not automatically add the Google Sign-In URL scheme to iOS. You must verify and add it manually. - -#### Verify and Add URL Scheme to Info.plist - -1. Open `ios/manadeck/Info.plist` -2. Find the `CFBundleURLTypes` array -3. Add a new URL scheme entry for Google Sign-In: - -```xml -CFBundleURLTypes - - - - CFBundleURLSchemes - - manadeck - com.tilljs.manadeck - - - - - - CFBundleURLSchemes - - com.googleusercontent.apps.111768794939-cgen6eklloo7k8vppcaq01o8r8nd7anb - - - -``` - -**Replace** `111768794939-cgen6eklloo7k8vppcaq01o8r8nd7anb` with your actual iOS Client ID. - -#### Why This is Required - -Without this URL scheme, Google Sign-In will fail with: -``` -Your app is missing support for the following URL schemes: -com.googleusercontent.apps.XXXXX -``` - -iOS uses this URL scheme to redirect back to your app after Google authentication. - -## Backend Requirements - -Your Mana Core backend must support the following endpoints: - -### POST `/v1/auth/google-signin` - -**⚠️ Important**: The backend expects `deviceInfo` as a **nested object**, not spread at the root level. - -Request body: -```json -{ - "token": "GOOGLE_ID_TOKEN", - "deviceInfo": { - "deviceId": "device-uuid", - "deviceName": "iPhone 15 Pro", - "deviceType": "ios" - } -} -``` - -Response: -```json -{ - "appToken": "JWT_TOKEN", - "refreshToken": "REFRESH_TOKEN" -} -``` - -### POST `/v1/auth/apple-signin` - -**⚠️ Important**: The backend expects `deviceInfo` as a **nested object**, not spread at the root level. - -Request body: -```json -{ - "token": "APPLE_IDENTITY_TOKEN", - "deviceInfo": { - "deviceId": "device-uuid", - "deviceName": "iPhone 15 Pro", - "deviceType": "ios" - } -} -``` - -Response: -```json -{ - "appToken": "JWT_TOKEN", - "refreshToken": "REFRESH_TOKEN" -} -``` - -**Common Error**: If you send device info spread at root level instead of nested: -```json -// ❌ WRONG - Will fail with "Complete device information is required" -{ - "token": "...", - "deviceId": "...", - "deviceName": "...", - "deviceType": "ios" -} - -// ✅ CORRECT - deviceInfo as nested object -{ - "token": "...", - "deviceInfo": { - "deviceId": "...", - "deviceName": "...", - "deviceType": "ios" - } -} -``` - -## Testing - -### Test on iOS - -1. Build and run: - ```bash - cd /Users/tillschneider/Documents/__00__Code/manadeck/apps/mobile - npx expo run:ios - ``` - -2. Test Google Sign-In: - - Tap "Mit Google anmelden" - - Should show Google account picker - - Select account - - Should authenticate and navigate to home - -3. Test Apple Sign-In: - - Tap "Mit Apple anmelden" - - Should show Face ID/Touch ID prompt - - Authenticate - - Should navigate to home - -### Test on Android - -1. Build and run: - ```bash - npx expo run:android - ``` - -2. Test Google Sign-In: - - Tap "Mit Google anmelden" - - Should show Google account picker - - Select account - - Should authenticate and navigate to home - -3. Apple Sign-In won't show on Android (iOS only) - -## Project Structure - -The social authentication implementation includes: - -``` -manadeck/apps/mobile/ -├── services/ -│ └── authService.ts # Extended with Google/Apple methods -├── store/ -│ └── authStore.ts # Updated with social sign-in actions -├── components/ -│ └── auth/ -│ ├── GoogleSignInButton.tsx # Google Sign-In button component -│ └── AppleSignInButton.tsx # Apple Sign-In button component -├── app/ -│ └── (auth)/ -│ └── login.tsx # Updated with social buttons -├── app.json # Configured with plugins -└── .env.local # OAuth credentials -``` - -## Troubleshooting - -### Google Sign-In Issues - -#### "Your app is missing support for the following URL schemes" on iOS -**Cause**: Google Sign-In URL scheme not added to Info.plist - -**Solution**: -1. Open `ios/manadeck/Info.plist` -2. Add the Google Sign-In URL scheme to `CFBundleURLTypes`: - ```xml - - CFBundleURLSchemes - - com.googleusercontent.apps.YOUR_IOS_CLIENT_ID - - - ``` -3. Replace `YOUR_IOS_CLIENT_ID` with your actual iOS Client ID -4. Rebuild the app: `npx expo run:ios` - -#### "DEVELOPER_ERROR" on Android -**Cause**: SHA-1 fingerprint mismatch or incorrect web client ID - -**Solution**: -```bash -# Get your SHA-1 -cd android && ./gradlew signingReport - -# Add SHA-1 to Google Cloud Console -# Use Web Client ID (not Android Client ID) in EXPO_PUBLIC_GOOGLE_CLIENT_ID -``` - -#### "Sign-in failed" on iOS -**Cause**: Incorrect iOS Client ID or bundle identifier mismatch - -**Solution**: -- Verify `EXPO_PUBLIC_GOOGLE_IOS_CLIENT_ID` matches Google Cloud Console -- Verify bundle identifier in `app.json` matches Google Cloud Console -- Update `reservedClientId` in `app.json` with correct iOS Client ID - -#### "Play Services not available" -**Cause**: Google Play Services missing or outdated on Android - -**Solution**: -- Update Google Play Services on device -- Test on device with Google Play Store installed -- Use emulator with Google Play - -### Apple Sign-In Issues - -#### Button doesn't appear -**Cause**: Platform is not iOS - -**Solution**: Apple Sign-In only works on iOS 13+ - -#### "Operation canceled" every time -**Cause**: Sign in with Apple not enabled in developer portal - -**Solution**: -- Enable capability in Apple Developer Portal -- Add capability in Xcode -- Ensure `usesAppleSignIn: true` in `app.json` - -### Backend Connection Issues - -#### "Complete device information is required" -**Cause**: Device info sent incorrectly (spread at root instead of nested object) - -**Solution**: -Ensure your authService sends `deviceInfo` as a nested object: -```typescript -// ✅ Correct -body: JSON.stringify({ - token: idToken, - deviceInfo, // Nested object -}) - -// ❌ Wrong -body: JSON.stringify({ - token: idToken, - ...deviceInfo, // Spread at root - will fail -}) -``` - -#### "Network error" or timeout -**Cause**: Backend URL incorrect or unreachable - -**Solution**: -- Verify `EXPO_PUBLIC_API_URL` is correct -- Test backend health endpoint -- Check network connectivity -- Ensure HTTPS is used (not HTTP) - -#### "Invalid token" or "Authentication failed" -**Cause**: Backend endpoints not implemented or configured incorrectly - -**Solution**: -- Verify backend supports `/v1/auth/google-signin` and `/v1/auth/apple-signin` -- Check backend logs for detailed error messages -- Ensure backend validates tokens correctly with Google/Apple - -## Security Considerations - -1. **Never commit credentials**: Keep `.env.local` in `.gitignore` -2. **Use HTTPS only**: Always use HTTPS for backend communication -3. **Validate tokens on backend**: Always validate social tokens on the backend -4. **Device binding**: Tokens are bound to device IDs for security -5. **Secure storage**: Tokens stored using platform-specific secure storage - -## Production Setup - -### For Production Release - -**Android Production SHA-1:** - -When ready to publish to Google Play, get your production SHA-1: - -```bash -# For EAS builds -eas credentials -p android - -# Or if using your own keystore -keytool -list -v -keystore /path/to/release.keystore -alias YOUR_KEY_ALIAS -``` - -Add the production SHA-1 to your Android OAuth client in Google Cloud Console. - -**iOS Production:** - -The same iOS Client ID works for both development and production. - -## Additional Resources - -- [React Native Google Sign-In Documentation](https://github.com/react-native-google-signin/google-signin) -- [Expo Apple Authentication Documentation](https://docs.expo.dev/versions/latest/sdk/apple-authentication/) -- [Google OAuth 2.0 Documentation](https://developers.google.com/identity/protocols/oauth2) -- [Apple Sign In Guidelines](https://developer.apple.com/sign-in-with-apple/) - -## Quick Reference - -### Your Credentials (Fill in as you obtain them) - -``` -Web OAuth Client ID: ________________________________.apps.googleusercontent.com -iOS OAuth Client ID: ________________________________.apps.googleusercontent.com -Android SHA-1 (Debug): ________________________________ -Android SHA-1 (Prod): ________________________________ -Apple Team ID: QP3GLU8PH3 -Bundle ID: com.tilljs.manadeck -Package Name: com.tilljs.manadeck -``` - -### Important Commands - -```bash -# Get Android SHA-1 -cd android && ./gradlew signingReport - -# Rebuild native code -npx expo prebuild --clean - -# Run on iOS -npx expo run:ios - -# Run on Android -npx expo run:android - -# Build with EAS -eas build --profile development -``` - -## Support - -For issues or questions: -1. Check the troubleshooting section above -2. Review backend logs for detailed error messages -3. Consult Google Cloud Console and Apple Developer Portal documentation -4. Check that all credentials are correctly configured - ---- - -**Integration completed successfully!** Social authentication is now available in the Manadeck mobile app. diff --git a/apps/manadeck/apps/mobile/app.json b/apps/manadeck/apps/mobile/app.json index 2a411934c..8d07bfe3a 100644 --- a/apps/manadeck/apps/mobile/app.json +++ b/apps/manadeck/apps/mobile/app.json @@ -36,13 +36,7 @@ "NSSpeechRecognitionUsageDescription": "Diese App verwendet Spracherkennung, um Sprachaufnahmen in Text umzuwandeln.", "NSDocumentsFolderUsageDescription": "Diese App benötigt Zugriff auf Dokumente, um Lernmaterialien zu importieren." }, - "appleTeamId": "QP3GLU8PH3", - "config": { - "googleSignIn": { - "reservedClientId": "com.googleusercontent.apps.111768794939-cgen6eklloo7k8vppcaq01o8r8nd7anb" - } - }, - "usesAppleSignIn": true + "appleTeamId": "QP3GLU8PH3" }, "android": { "adaptiveIcon": { @@ -63,10 +57,6 @@ "projectId": "6cb9cf81-a4d5-4c72-b57d-1be3da8eba35" } }, - "plugins": [ - "expo-router", - "@react-native-google-signin/google-signin", - "expo-apple-authentication" - ] + "plugins": ["expo-router"] } } diff --git a/apps/manadeck/apps/mobile/app/(auth)/login.tsx b/apps/manadeck/apps/mobile/app/(auth)/login.tsx index 96c066dd1..2e653337a 100644 --- a/apps/manadeck/apps/mobile/app/(auth)/login.tsx +++ b/apps/manadeck/apps/mobile/app/(auth)/login.tsx @@ -8,8 +8,6 @@ import { Button } from '../../components/ui/Button'; import { Input } from '../../components/ui/Input'; import { Card } from '../../components/ui/Card'; import { useThemeColors } from '~/utils/themeUtils'; -import { GoogleSignInButton } from '../../components/auth/GoogleSignInButton'; -import { AppleSignInButton } from '../../components/auth/AppleSignInButton'; import { spacing } from '~/utils/spacing'; export default function LoginScreen() { @@ -18,8 +16,7 @@ export default function LoginScreen() { const [errors, setErrors] = useState<{ email?: string; password?: string }>({}); const colors = useThemeColors(); - const { signIn, signInWithGoogle, signInWithApple, isLoading, error, clearError } = - useAuthStore(); + const { signIn, isLoading, error, clearError } = useAuthStore(); const validateForm = () => { const newErrors: { email?: string; password?: string } = {}; @@ -52,28 +49,6 @@ export default function LoginScreen() { } }; - const handleGoogleSignIn = async (idToken: string) => { - try { - clearError(); - await signInWithGoogle(idToken); - router.replace('/(tabs)'); - } catch (err: any) { - // Error is already handled in GoogleSignInButton - throw err; - } - }; - - const handleAppleSignIn = async (identityToken: string) => { - try { - clearError(); - await signInWithApple(identityToken); - router.replace('/(tabs)'); - } catch (err: any) { - // Error is already handled in AppleSignInButton - throw err; - } - }; - return ( - {/* Social Sign-In Divider */} - - - - oder - - - - - {/* Social Sign-In Buttons */} - - console.log('Google sign-in successful')} - onSignInError={(error) => console.error('Google sign-in error:', error)} - /> - console.log('Apple sign-in successful')} - onSignInError={(error) => console.error('Apple sign-in error:', error)} - /> - - void; - onSignInError?: (error: string) => void; - onSignIn: (identityToken: string) => Promise; -} - -export const AppleSignInButton: React.FC = ({ - onSignInSuccess, - onSignInError, - onSignIn, -}) => { - const colors = useThemeColors(); - const [isLoading, setIsLoading] = useState(false); - - // Apple Sign-In is iOS only - if (Platform.OS !== 'ios') { - return null; - } - - const handleAppleSignIn = async () => { - setIsLoading(true); - try { - // Trigger Apple Sign-In - const credential = await AppleAuthentication.signInAsync({ - requestedScopes: [ - AppleAuthentication.AppleAuthenticationScope.FULL_NAME, - AppleAuthentication.AppleAuthenticationScope.EMAIL, - ], - }); - - const identityToken = credential.identityToken; - - if (!identityToken) { - Alert.alert('Anmeldung fehlgeschlagen', 'Kein Identity Token von Apple erhalten'); - if (onSignInError) { - onSignInError('Kein Identity Token erhalten'); - } - return; - } - - console.log('Got Apple identity token'); - - // Send to backend for validation - await onSignIn(identityToken); - - if (onSignInSuccess) { - onSignInSuccess(); - } - } catch (error: any) { - if (error.code === 'ERR_REQUEST_CANCELED') { - console.log('User cancelled Apple sign-in'); - } else { - console.error('Apple Sign-In Error:', error); - const errorMessage = error.message || 'Anmeldung mit Apple fehlgeschlagen'; - Alert.alert('Anmeldefehler', errorMessage); - if (onSignInError) { - onSignInError(errorMessage); - } - } - } finally { - setIsLoading(false); - } - }; - - return ( - - {isLoading ? ( - - ) : ( - <> - - Mit Apple anmelden - - )} - - ); -}; - -const styles = StyleSheet.create({ - button: { - flexDirection: 'row', - alignItems: 'center', - justifyContent: 'center', - padding: 16, - borderRadius: 8, - minHeight: 52, - }, - icon: { - marginRight: 12, - }, - buttonText: { - fontSize: 16, - fontWeight: '600', - color: '#FFFFFF', - }, -}); diff --git a/apps/manadeck/apps/mobile/components/auth/GoogleSignInButton.tsx b/apps/manadeck/apps/mobile/components/auth/GoogleSignInButton.tsx deleted file mode 100644 index 1bce3f2bb..000000000 --- a/apps/manadeck/apps/mobile/components/auth/GoogleSignInButton.tsx +++ /dev/null @@ -1,120 +0,0 @@ -import React, { useEffect, useState } from 'react'; -import { TouchableOpacity, StyleSheet, Alert, Platform, ActivityIndicator } from 'react-native'; -import { GoogleSignin, statusCodes } from '@react-native-google-signin/google-signin'; -import { router } from 'expo-router'; -import { Text } from '~/components/ui/Text'; -import { useThemeColors } from '~/utils/themeUtils'; -import { Ionicons } from '@expo/vector-icons'; - -interface GoogleSignInButtonProps { - onSignInSuccess?: () => void; - onSignInError?: (error: string) => void; - onSignIn: (idToken: string) => Promise; -} - -export const GoogleSignInButton: React.FC = ({ - onSignInSuccess, - onSignInError, - onSignIn, -}) => { - const colors = useThemeColors(); - const [isLoading, setIsLoading] = useState(false); - - useEffect(() => { - // Configure Google Sign-In - GoogleSignin.configure({ - webClientId: process.env.EXPO_PUBLIC_GOOGLE_CLIENT_ID, - iosClientId: process.env.EXPO_PUBLIC_GOOGLE_IOS_CLIENT_ID, - scopes: ['profile', 'email'], - offlineAccess: false, - }); - }, []); - - const handleGoogleSignIn = async () => { - setIsLoading(true); - try { - // Check Google Play Services (Android only) - if (Platform.OS === 'android') { - await GoogleSignin.hasPlayServices(); - } - - // Trigger Google Sign-In - await GoogleSignin.signIn(); - - // Get ID token - const tokens = await GoogleSignin.getTokens(); - const idToken = tokens.idToken; - - console.log('Got Google ID token'); - - // Send to backend for validation - await onSignIn(idToken); - - if (onSignInSuccess) { - onSignInSuccess(); - } - } catch (error: any) { - console.error('Google Sign-In Error:', error); - - // Handle specific error codes - if (error.code === statusCodes.SIGN_IN_CANCELLED) { - console.log('User cancelled sign-in'); - } else if (error.code === statusCodes.IN_PROGRESS) { - console.log('Sign-in already in progress'); - } else if (error.code === statusCodes.PLAY_SERVICES_NOT_AVAILABLE) { - Alert.alert( - 'Google Play Services', - 'Google Play Services ist nicht verfügbar oder veraltet. Bitte aktualisieren Sie es.' - ); - if (onSignInError) { - onSignInError('Google Play Services nicht verfügbar'); - } - } else { - const errorMessage = error.message || 'Anmeldung mit Google fehlgeschlagen'; - Alert.alert('Anmeldefehler', errorMessage); - if (onSignInError) { - onSignInError(errorMessage); - } - } - } finally { - setIsLoading(false); - } - }; - - return ( - - {isLoading ? ( - - ) : ( - <> - - Mit Google anmelden - - )} - - ); -}; - -const styles = StyleSheet.create({ - button: { - flexDirection: 'row', - alignItems: 'center', - justifyContent: 'center', - padding: 16, - borderRadius: 8, - borderWidth: 1, - minHeight: 52, - }, - icon: { - marginRight: 12, - }, - buttonText: { - fontSize: 16, - fontWeight: '600', - }, -}); diff --git a/apps/manadeck/apps/mobile/package.json b/apps/manadeck/apps/mobile/package.json index 6aac03d43..69ca12bda 100644 --- a/apps/manadeck/apps/mobile/package.json +++ b/apps/manadeck/apps/mobile/package.json @@ -22,13 +22,11 @@ "@expo/vector-icons": "^15.0.2", "@react-native-async-storage/async-storage": "2.2.0", "@react-native-community/netinfo": "^11.4.1", - "@react-native-google-signin/google-signin": "^14.0.2", "@react-native-segmented-control/segmented-control": "2.5.7", "@react-navigation/native": "^7.0.3", "base64-js": "^1.5.1", "class-variance-authority": "^0.7.1", "expo": "54.0.13", - "expo-apple-authentication": "~8.0.7", "expo-blur": "~15.0.7", "expo-build-properties": "~1.0.9", "expo-constants": "~18.0.9", diff --git a/apps/manadeck/apps/mobile/services/authService.ts b/apps/manadeck/apps/mobile/services/authService.ts index 8c9448a82..8d924f563 100644 --- a/apps/manadeck/apps/mobile/services/authService.ts +++ b/apps/manadeck/apps/mobile/services/authService.ts @@ -223,42 +223,6 @@ export const authService = { } }, - signInWithGoogle: async ( - idToken: string - ): Promise<{ success: boolean; user?: ManaUser; error?: string }> => { - try { - const result = await _sharedAuth.signInWithGoogle(idToken); - if (!result.success) { - return { success: false, error: result.error || 'Google sign-in failed' }; - } - const userData = await _sharedAuth.getUserFromToken(); - return { success: true, user: toManaUser(userData) || undefined }; - } catch (error) { - return { - success: false, - error: error instanceof Error ? error.message : 'Unknown error', - }; - } - }, - - signInWithApple: async ( - identityToken: string - ): Promise<{ success: boolean; user?: ManaUser; error?: string }> => { - try { - const result = await _sharedAuth.signInWithApple(identityToken); - if (!result.success) { - return { success: false, error: result.error || 'Apple sign-in failed' }; - } - const userData = await _sharedAuth.getUserFromToken(); - return { success: true, user: toManaUser(userData) || undefined }; - } catch (error) { - return { - success: false, - error: error instanceof Error ? error.message : 'Unknown error', - }; - } - }, - onTokenRefresh: null as ((userData: { id: string; email: string; role: string }) => void) | null, }; diff --git a/apps/manadeck/apps/mobile/store/authStore.ts b/apps/manadeck/apps/mobile/store/authStore.ts index fa81a4604..9766d4624 100644 --- a/apps/manadeck/apps/mobile/store/authStore.ts +++ b/apps/manadeck/apps/mobile/store/authStore.ts @@ -11,8 +11,6 @@ interface AuthState { initialize: () => Promise; signIn: (email: string, password: string) => Promise; signUp: (email: string, password: string, username: string) => Promise; - signInWithGoogle: (idToken: string) => Promise; - signInWithApple: (identityToken: string) => Promise; signOut: () => Promise; resetPassword: (email: string) => Promise; updateProfile: (updates: { @@ -110,44 +108,6 @@ export const useAuthStore = create((set, get) => ({ } }, - signInWithGoogle: async (idToken: string) => { - try { - set({ isLoading: true, error: null }); - - const result = await authService.signInWithGoogle(idToken); - - if (!result.success) { - throw new Error(result.error || 'Google sign-in failed'); - } - - set({ user: result.user || null }); - } catch (error: any) { - set({ error: error.message || 'Google sign-in failed' }); - throw error; - } finally { - set({ isLoading: false }); - } - }, - - signInWithApple: async (identityToken: string) => { - try { - set({ isLoading: true, error: null }); - - const result = await authService.signInWithApple(identityToken); - - if (!result.success) { - throw new Error(result.error || 'Apple sign-in failed'); - } - - set({ user: result.user || null }); - } catch (error: any) { - set({ error: error.message || 'Apple sign-in failed' }); - throw error; - } finally { - set({ isLoading: false }); - } - }, - signOut: async () => { try { set({ isLoading: true, error: null }); diff --git a/apps/manadeck/apps/web/src/lib/auth.ts b/apps/manadeck/apps/web/src/lib/auth.ts index 5f9403469..c250c5e8c 100644 --- a/apps/manadeck/apps/web/src/lib/auth.ts +++ b/apps/manadeck/apps/web/src/lib/auth.ts @@ -140,8 +140,6 @@ export const authService = createAuthService({ refresh: '/api/v1/auth/refresh', validate: '/api/v1/auth/validate', forgotPassword: '/api/v1/auth/forgot-password', - googleSignIn: '/api/v1/auth/google-signin', - appleSignIn: '/api/v1/auth/apple-signin', credits: '/api/v1/credits/balance', }, }); diff --git a/apps/manadeck/apps/web/src/routes/(auth)/login/+page.svelte b/apps/manadeck/apps/web/src/routes/(auth)/login/+page.svelte index ef2c3d87b..0d969c437 100644 --- a/apps/manadeck/apps/web/src/routes/(auth)/login/+page.svelte +++ b/apps/manadeck/apps/web/src/routes/(auth)/login/+page.svelte @@ -33,8 +33,6 @@ onSignIn={handleSignIn} onResendVerification={handleResendVerification} {goto} - enableGoogle={false} - enableApple={false} successRedirect="/decks" registerPath="/register" forgotPasswordPath="/forgot-password" diff --git a/apps/mukke/apps/web/src/routes/(auth)/login/+page.svelte b/apps/mukke/apps/web/src/routes/(auth)/login/+page.svelte index 4c331921d..36655d1fc 100644 --- a/apps/mukke/apps/web/src/routes/(auth)/login/+page.svelte +++ b/apps/mukke/apps/web/src/routes/(auth)/login/+page.svelte @@ -51,8 +51,6 @@ onSignIn={handleSignIn} onResendVerification={handleResendVerification} {goto} - enableGoogle={false} - enableApple={false} successRedirect={redirectTo} registerPath="/register" forgotPasswordPath="/forgot-password" diff --git a/apps/nutriphi/apps/web/src/routes/(auth)/login/+page.svelte b/apps/nutriphi/apps/web/src/routes/(auth)/login/+page.svelte index 6915611f0..28650cb79 100644 --- a/apps/nutriphi/apps/web/src/routes/(auth)/login/+page.svelte +++ b/apps/nutriphi/apps/web/src/routes/(auth)/login/+page.svelte @@ -53,8 +53,6 @@ onSignIn={handleSignIn} onResendVerification={handleResendVerification} {goto} - enableGoogle={false} - enableApple={false} successRedirect={redirectTo} registerPath="/register" forgotPasswordPath="/forgot-password" diff --git a/apps/photos/apps/web/src/routes/(auth)/login/+page.svelte b/apps/photos/apps/web/src/routes/(auth)/login/+page.svelte index 3d8afeec9..eae543453 100644 --- a/apps/photos/apps/web/src/routes/(auth)/login/+page.svelte +++ b/apps/photos/apps/web/src/routes/(auth)/login/+page.svelte @@ -44,8 +44,6 @@ onSignIn={handleSignIn} onResendVerification={handleResendVerification} {goto} - enableGoogle={false} - enableApple={false} successRedirect={redirectTo} registerPath="/register" forgotPasswordPath="/forgot-password" diff --git a/apps/picture/apps/web/src/routes/auth/login/+page.svelte b/apps/picture/apps/web/src/routes/auth/login/+page.svelte index aa727a3e3..486313c5d 100644 --- a/apps/picture/apps/web/src/routes/auth/login/+page.svelte +++ b/apps/picture/apps/web/src/routes/auth/login/+page.svelte @@ -2,25 +2,17 @@ import { goto } from '$app/navigation'; import { page } from '$app/stores'; import { locale } from 'svelte-i18n'; - import { LoginPage, setGoogleClientId } from '@manacore/shared-auth-ui'; + import { LoginPage } from '@manacore/shared-auth-ui'; import { getLoginTranslations } from '@manacore/shared-i18n'; import PictureLogo from '$lib/components/branding/PictureLogo.svelte'; import AppSlider from '$lib/components/AppSlider.svelte'; import LanguageSelector from '$lib/components/LanguageSelector.svelte'; import { authStore } from '$lib/stores/auth.svelte'; import { APP_VERSION, BUILD_TIME } from '$lib/version'; - import { onMount } from 'svelte'; - import { PUBLIC_GOOGLE_CLIENT_ID, PUBLIC_APPLE_CLIENT_ID } from '$env/static/public'; // Get translations based on current locale const translations = $derived(getLoginTranslations($locale || 'de')); - onMount(() => { - if (PUBLIC_GOOGLE_CLIENT_ID) { - setGoogleClientId(PUBLIC_GOOGLE_CLIENT_ID); - } - }); - async function handleSignIn(email: string, password: string) { return authStore.signIn(email, password); } @@ -29,16 +21,6 @@ return authStore.resendVerificationEmail(email); } - async function handleSignInWithGoogle() { - // TODO: Implement OAuth with Mana Core Auth when ready - return { success: false, error: 'Google Sign-In not yet implemented' }; - } - - async function handleSignInWithApple() { - // TODO: Implement OAuth with Mana Core Auth when ready - return { success: false, error: 'Apple Sign-In not yet implemented' }; - } - // Read verification status from query params (set after email verification) const verified = $derived($page.url.searchParams.get('verified') === 'true'); const initialEmail = $derived($page.url.searchParams.get('email') || ''); @@ -54,11 +36,7 @@ primaryColor="#3b82f6" onSignIn={handleSignIn} onResendVerification={handleResendVerification} - onSignInWithGoogle={PUBLIC_GOOGLE_CLIENT_ID ? handleSignInWithGoogle : undefined} - onSignInWithApple={PUBLIC_APPLE_CLIENT_ID ? handleSignInWithApple : undefined} {goto} - enableGoogle={!!PUBLIC_GOOGLE_CLIENT_ID} - enableApple={!!PUBLIC_APPLE_CLIENT_ID} successRedirect="/app/gallery" registerPath="/auth/signup" forgotPasswordPath="/auth/forgot-password" diff --git a/apps/planta/apps/web/src/routes/(auth)/login/+page.svelte b/apps/planta/apps/web/src/routes/(auth)/login/+page.svelte index a01146fb1..8891fc956 100644 --- a/apps/planta/apps/web/src/routes/(auth)/login/+page.svelte +++ b/apps/planta/apps/web/src/routes/(auth)/login/+page.svelte @@ -53,8 +53,6 @@ onSignIn={handleSignIn} onResendVerification={handleResendVerification} {goto} - enableGoogle={false} - enableApple={false} successRedirect={redirectTo} registerPath="/register" forgotPasswordPath="/forgot-password" diff --git a/apps/playground/apps/web/src/routes/(auth)/login/+page.svelte b/apps/playground/apps/web/src/routes/(auth)/login/+page.svelte index 394c1c3bf..2ed380544 100644 --- a/apps/playground/apps/web/src/routes/(auth)/login/+page.svelte +++ b/apps/playground/apps/web/src/routes/(auth)/login/+page.svelte @@ -35,8 +35,6 @@ onSignIn={handleSignIn} onResendVerification={handleResendVerification} {goto} - enableGoogle={false} - enableApple={false} successRedirect={redirectTo} registerPath="/register" forgotPasswordPath="/forgot-password" diff --git a/apps/presi/apps/web/src/routes/(auth)/login/+page.svelte b/apps/presi/apps/web/src/routes/(auth)/login/+page.svelte index 806e2689d..fdead3efa 100644 --- a/apps/presi/apps/web/src/routes/(auth)/login/+page.svelte +++ b/apps/presi/apps/web/src/routes/(auth)/login/+page.svelte @@ -41,8 +41,6 @@ onSignIn={handleSignIn} onResendVerification={handleResendVerification} {goto} - enableGoogle={false} - enableApple={false} successRedirect={redirectTo} registerPath="/register" forgotPasswordPath="/forgot-password" diff --git a/apps/questions/apps/web/src/routes/(auth)/login/+page.svelte b/apps/questions/apps/web/src/routes/(auth)/login/+page.svelte index 143431679..61534ba6a 100644 --- a/apps/questions/apps/web/src/routes/(auth)/login/+page.svelte +++ b/apps/questions/apps/web/src/routes/(auth)/login/+page.svelte @@ -59,8 +59,6 @@ onSignIn={handleSignIn} onResendVerification={handleResendVerification} {goto} - enableGoogle={false} - enableApple={false} successRedirect={redirectTo} registerPath="/register" forgotPasswordPath="/forgot-password" diff --git a/apps/skilltree/apps/web/src/routes/(auth)/login/+page.svelte b/apps/skilltree/apps/web/src/routes/(auth)/login/+page.svelte index a053cb526..dc1ec65b5 100644 --- a/apps/skilltree/apps/web/src/routes/(auth)/login/+page.svelte +++ b/apps/skilltree/apps/web/src/routes/(auth)/login/+page.svelte @@ -59,8 +59,6 @@ onSignIn={handleSignIn} onResendVerification={handleResendVerification} {goto} - enableGoogle={false} - enableApple={false} successRedirect={redirectTo} registerPath="/register" forgotPasswordPath="/forgot-password" diff --git a/apps/todo/apps/web/src/routes/(auth)/login/+page.svelte b/apps/todo/apps/web/src/routes/(auth)/login/+page.svelte index 1dc0a04bb..a1e19cdf5 100644 --- a/apps/todo/apps/web/src/routes/(auth)/login/+page.svelte +++ b/apps/todo/apps/web/src/routes/(auth)/login/+page.svelte @@ -56,8 +56,6 @@ onSignIn={handleSignIn} onResendVerification={handleResendVerification} {goto} - enableGoogle={false} - enableApple={false} successRedirect={redirectTo} registerPath="/register" forgotPasswordPath="/forgot-password" diff --git a/apps/zitare/apps/web/src/routes/(auth)/login/+page.svelte b/apps/zitare/apps/web/src/routes/(auth)/login/+page.svelte index afd9da0b7..6530a6382 100644 --- a/apps/zitare/apps/web/src/routes/(auth)/login/+page.svelte +++ b/apps/zitare/apps/web/src/routes/(auth)/login/+page.svelte @@ -54,8 +54,6 @@ onSignIn={handleSignIn} onResendVerification={handleResendVerification} {goto} - enableGoogle={false} - enableApple={false} successRedirect={redirectTo} registerPath="/register" forgotPasswordPath="/forgot-password" diff --git a/packages/shared-auth-ui/src/components/AppleSignInButton.svelte b/packages/shared-auth-ui/src/components/AppleSignInButton.svelte deleted file mode 100644 index bcc6c3d5f..000000000 --- a/packages/shared-auth-ui/src/components/AppleSignInButton.svelte +++ /dev/null @@ -1,71 +0,0 @@ - - -{#if sdkLoaded} -
- {#if error} -
- {error} -
- {/if} - - -
-{/if} diff --git a/packages/shared-auth-ui/src/components/GoogleSignInButton.svelte b/packages/shared-auth-ui/src/components/GoogleSignInButton.svelte deleted file mode 100644 index dad3ed302..000000000 --- a/packages/shared-auth-ui/src/components/GoogleSignInButton.svelte +++ /dev/null @@ -1,84 +0,0 @@ - - -{#if error} -
- {error} -
-{/if} - -
- {#if isLoading} -
-
-
- {/if} -
- - diff --git a/packages/shared-auth-ui/src/index.ts b/packages/shared-auth-ui/src/index.ts index f0282c5cd..4299de571 100644 --- a/packages/shared-auth-ui/src/index.ts +++ b/packages/shared-auth-ui/src/index.ts @@ -4,34 +4,12 @@ export { default as RegisterPage } from './pages/RegisterPage.svelte'; export { default as ForgotPasswordPage } from './pages/ForgotPasswordPage.svelte'; // Components -export { default as GoogleSignInButton } from './components/GoogleSignInButton.svelte'; -export { default as AppleSignInButton } from './components/AppleSignInButton.svelte'; export { default as GuestWelcomeModal } from './components/GuestWelcomeModal.svelte'; export { default as AuthGateModal } from './components/AuthGateModal.svelte'; export { default as SessionExpiredBanner } from './components/SessionExpiredBanner.svelte'; export { default as AuthGate } from './components/AuthGate.svelte'; // Utilities -export { - setGoogleClientId, - initializeGoogleAuth, - renderGoogleButton, - isGoogleAuthLoaded, - waitForGoogleAuth, -} from './utils/googleAuth'; - -export { - setAppleConfig, - initializeAppleAuth, - signInWithApple, - parseAppleAuthorizationResponse, - getStoredReturnUrl, - clearAppleSignInSession, - isAppleAuthLoaded, - waitForAppleAuth, - type AppleAuthorizationResponse, -} from './utils/appleAuth'; - export { shouldShowGuestWelcome, markGuestWelcomeSeen, diff --git a/packages/shared-auth-ui/src/pages/LoginPage.svelte b/packages/shared-auth-ui/src/pages/LoginPage.svelte index dcf293f5f..1cfc1677f 100644 --- a/packages/shared-auth-ui/src/pages/LoginPage.svelte +++ b/packages/shared-auth-ui/src/pages/LoginPage.svelte @@ -2,9 +2,6 @@ import type { Component, Snippet } from 'svelte'; import type { AuthResult } from '../types'; import { Check, Warning, Eye, EyeSlash, SignIn, Sun, Moon } from '@manacore/shared-icons'; - import GoogleSignInButton from '../components/GoogleSignInButton.svelte'; - import AppleSignInButton from '../components/AppleSignInButton.svelte'; - /** Translation strings for the login page */ export interface LoginTranslations { title: string; @@ -26,9 +23,7 @@ emailInvalid: string; passwordRequired: string; signInFailed: string; - googleSignInFailed: string; signInSuccess: string; - googleSignInSuccess: string; emailVerified?: string; emailNotVerified?: string; resendVerification?: string; @@ -56,9 +51,7 @@ emailInvalid: 'Please enter a valid email address', passwordRequired: 'Password is required', signInFailed: 'Sign in failed', - googleSignInFailed: 'Google sign in failed', signInSuccess: 'Successfully signed in. Redirecting...', - googleSignInSuccess: 'Successfully signed in with Google. Redirecting...', emailVerified: 'Email successfully verified! Please sign in.', emailNotVerified: 'Email not verified.', resendVerification: 'Resend verification email', @@ -71,12 +64,8 @@ logo: Component<{ size?: number; color?: string }>; primaryColor: string; onSignIn: (email: string, password: string) => Promise; - onSignInWithGoogle?: (idToken: string) => Promise; - onSignInWithApple?: (identityToken: string) => Promise; onResendVerification?: (email: string) => Promise; goto: (path: string) => void; - enableGoogle?: boolean; - enableApple?: boolean; successRedirect?: string; registerPath?: string; forgotPasswordPath?: string; @@ -102,12 +91,8 @@ logo: Logo, primaryColor, onSignIn, - onSignInWithGoogle, - onSignInWithApple, onResendVerification, goto, - enableGoogle = false, - enableApple = false, successRedirect = '/dashboard', registerPath = '/register', forgotPasswordPath = '/forgot-password', @@ -269,23 +254,6 @@ } } - async function handleGoogleSuccess(idToken: string) { - if (!onSignInWithGoogle) return; - loading = true; - clearError(); - - const result = await onSignInWithGoogle(idToken); - loading = false; - - if (result.success) { - showSuccess = true; - successAnnouncement = t.googleSignInSuccess; - setTimeout(() => goto(successRedirect), 600); - } else { - setError(result.error || t.googleSignInFailed, 'general'); - } - } - function skipToForm() { if (emailInput) emailInput.focus(); } @@ -519,20 +487,6 @@ - {#if enableGoogle || enableApple} -
- {t.orDivider} -
- - {/if} -