WIP: capacitor-firebase-auth might be dead
This commit is contained in:
		
							parent
							
								
									6997e123f6
								
							
						
					
					
						commit
						c92f032174
					
				|  | @ -5,10 +5,10 @@ const config: CapacitorConfig = { | ||||||
|   appName: 'Manifold Markets', |   appName: 'Manifold Markets', | ||||||
|   webDir: 'out', |   webDir: 'out', | ||||||
|   bundledWebRuntime: false, |   bundledWebRuntime: false, | ||||||
|   // TODO: Do we need this?
 |   server: { | ||||||
|   // server: {
 |     // Allow these sites to be loaded from the webview
 | ||||||
|   //   allowNavigation: ['oneword-cf74a.firebaseapp.com', 'accounts.google.com'],
 |     allowNavigation: ['mantic-markets.firebaseapp.com', 'accounts.google.com'], | ||||||
|   // },
 |   }, | ||||||
|   plugins: { |   plugins: { | ||||||
|     CapacitorFirebaseAuth: { |     CapacitorFirebaseAuth: { | ||||||
|       providers: ['google.com'], |       providers: ['google.com'], | ||||||
|  |  | ||||||
|  | @ -31,6 +31,8 @@ import { feed } from 'common/feed' | ||||||
| import { CATEGORY_LIST } from 'common/categories' | import { CATEGORY_LIST } from 'common/categories' | ||||||
| import { safeLocalStorage } from '../util/local' | import { safeLocalStorage } from '../util/local' | ||||||
| import { filterDefined } from 'common/util/array' | import { filterDefined } from 'common/util/array' | ||||||
|  | import { cfaSignIn } from 'capacitor-firebase-auth' | ||||||
|  | import { Capacitor } from '@capacitor/core' | ||||||
| 
 | 
 | ||||||
| export type { User } | export type { User } | ||||||
| 
 | 
 | ||||||
|  | @ -126,9 +128,17 @@ export function listenForLogin(onUser: (user: User | null) => void) { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| export async function firebaseLogin() { | export async function firebaseLogin() { | ||||||
|  |   if (Capacitor.getPlatform() === 'android') { | ||||||
|  |     // Seems broken, because we're on firebase v9 instead of v8...
 | ||||||
|  |     console.log('firebaseLogin: android') | ||||||
|  |     cfaSignIn('google.com').subscribe((u) => { | ||||||
|  |       console.log('firebaseLogin:', u) | ||||||
|  |     }) | ||||||
|  |   } else { | ||||||
|     const provider = new GoogleAuthProvider() |     const provider = new GoogleAuthProvider() | ||||||
|     return signInWithPopup(auth, provider) |     return signInWithPopup(auth, provider) | ||||||
|   } |   } | ||||||
|  | } | ||||||
| 
 | 
 | ||||||
| export async function firebaseLogout() { | export async function firebaseLogout() { | ||||||
|   auth.signOut() |   auth.signOut() | ||||||
|  |  | ||||||
|  | @ -10,7 +10,7 @@ | ||||||
|     "dev:emulate": "cross-env NEXT_PUBLIC_FIREBASE_EMULATE=TRUE yarn devdev", |     "dev:emulate": "cross-env NEXT_PUBLIC_FIREBASE_EMULATE=TRUE yarn devdev", | ||||||
|     "ts": "tsc --noEmit --incremental --preserveWatchOutput --pretty", |     "ts": "tsc --noEmit --incremental --preserveWatchOutput --pretty", | ||||||
|     "build": "next build", |     "build": "next build", | ||||||
|     "export": "next export", |     "export": "next build && next export", | ||||||
|     "start": "next start", |     "start": "next start", | ||||||
|     "lint": "next lint", |     "lint": "next lint", | ||||||
|     "format": "npx prettier --write .", |     "format": "npx prettier --write .", | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user