generated from UoaWDCC/react-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #75 from UoaWDCC/VOL-9/user-authentication-google
User Authentication with Google SignIn popup
- Loading branch information
Showing
2 changed files
with
25 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { initializeApp } from 'firebase/app'; | ||
import { getAuth, GoogleAuthProvider, signInWithPopup } from 'firebase/auth'; | ||
|
||
const firebaseConfig = { | ||
apiKey:"AIzaSyBox7z0b2SBEnz0v6qmQjFx3QfUJcG099U", | ||
authDomain:"volunteerclub-14b7a.firebaseapp.com", | ||
projectId:"volunteerclub-14b7a", | ||
storageBucket:"volunteerclub-14b7a.appspot.com", | ||
messagingSenderId:"765497707892", | ||
appId:"1:765497707892:web:d1fb4e8f77881366037021", | ||
measurementId:"G-TLM9P3DCKS", | ||
}; | ||
|
||
const app = initializeApp(firebaseConfig); | ||
|
||
// Export Firebase authentication service | ||
export const auth = getAuth(app); | ||
|
||
export const handleGoogle = async () => { | ||
const provider = await new GoogleAuthProvider(); | ||
return signInWithPopup(auth, provider); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters