Skip to content

Commit c19b432

Browse files
Update gpt.html
1 parent 5574a1f commit c19b432

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

gpt.html

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
66
<title>Firebase Authentication Example</title>
7-
<script type="module">
8-
// Import the functions you need from the SDKs you need
9-
import { initializeApp } from "https://www.gstatic.com/firebasejs/10.7.1/firebase-app.js";
10-
import { getAnalytics } from "https://www.gstatic.com/firebasejs/10.7.1/firebase-analytics.js";
11-
import { getAuth, signInWithEmailAndPassword, onAuthStateChanged } from "https://www.gstatic.com/firebasejs/10.7.1/firebase-auth.js";
12-
7+
<script src="https://www.gstatic.com/firebasejs/10.7.1/firebase-app.js"></script>
8+
<script src="https://www.gstatic.com/firebasejs/10.7.1/firebase-analytics.js"></script>
9+
<script src="https://www.gstatic.com/firebasejs/10.7.1/firebase-auth.js"></script>
10+
<script>
1311
// Your web app's Firebase configuration
1412
const firebaseConfig = {
1513
apiKey: "AIzaSyBH3LvyIKTVeEZ4KYFbxFAWumn2B9GtzTE",
@@ -22,15 +20,15 @@
2220
};
2321

2422
// Initialize Firebase
25-
const app = initializeApp(firebaseConfig);
26-
const analytics = getAnalytics(app);
27-
const auth = getAuth(app);
23+
firebase.initializeApp(firebaseConfig);
24+
firebase.analytics();
25+
const auth = firebase.auth();
2826

2927
// Sign in function
3028
function signIn() {
3129
var email = document.getElementById('email').value;
3230
var password = document.getElementById('password').value;
33-
signInWithEmailAndPassword(auth, email, password)
31+
auth.signInWithEmailAndPassword(email, password)
3432
.then((userCredential) => {
3533
// Signed in
3634
document.getElementById('status').innerText = 'Logged in successfully. Welcome, ' + userCredential.user.email;
@@ -43,7 +41,7 @@
4341
}
4442

4543
// Auth state changes
46-
onAuthStateChanged(auth, (user) => {
44+
auth.onAuthStateChanged((user) => {
4745
if (user) {
4846
// User is signed in
4947
document.getElementById('status').innerText = 'User is currently signed in';

0 commit comments

Comments
 (0)