mirror of
https://github.com/emailerfacu-spec/minix-front.git
synced 2026-04-09 14:30:44 -03:00
primer prueba de concepto para firebase
This commit is contained in:
17
src/lib/components/FireBaseButton.svelte
Normal file
17
src/lib/components/FireBaseButton.svelte
Normal file
@@ -0,0 +1,17 @@
|
||||
<script>
|
||||
import { getFirebaseAuth } from '$lib/stores/firebase.ts';
|
||||
import { GoogleAuthProvider, signInWithPopup } from 'firebase/auth';
|
||||
import Button from './ui/button/button.svelte';
|
||||
|
||||
const handleGoogleSignIn = async () => {
|
||||
const auth = getFirebaseAuth();
|
||||
const provider = new GoogleAuthProvider();
|
||||
try {
|
||||
await signInWithPopup(auth, provider);
|
||||
} catch (error) {
|
||||
console.error('Error signing in with Google:', error);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<Button onclick={handleGoogleSignIn}>Sign in with Google</Button>
|
||||
Reference in New Issue
Block a user