Skip to content
This repository was archived by the owner on Mar 10, 2021. It is now read-only.

Commit 54b1fdd

Browse files
committed
Show popup.html when login is succesful
1 parent deeec40 commit 54b1fdd

File tree

11 files changed

+43
-38
lines changed

11 files changed

+43
-38
lines changed

.DS_Store

0 Bytes
Binary file not shown.

public/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"browser_action": {
2424
"default_icon": "icon.png",
2525
"default_title": "Footsteps",
26-
"default_popup": "credentials.html"
26+
"default_popup": "auth.html"
2727
},
2828
"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlYYAiO9QEDcWW+LTz8SCyZ93mFALZ97gkgmWY36y6/dCtIzacLkFmYbZ/vgD9+TQgtmMgZsuHtGwp5dDMGbjMIa3yKEuy0YYeJ4aTpeQesjQL7/f7Jx1x8iXjVbj/GdFhuExOVSIANbWt+HD3+252D/0QVysDBmz9Zko1RMM4ptDfT1fQCo4Y/OllZbHo52KU+DieCkFKIvfGTy4j4rQn1RUGZ7JMTYj9hGCvzH0wPlRyMsFHDxeEIqQuQGDoahfoGFlI/KQpeBcI25Fr0Y2k1LE+JH5qUWpKcwBH4rJrdvjaepjGSg8Y5o/tunV9Oyx1+gLKLLIKqIQUNtPG+eViwIDAQAB",
2929
"oauth2": {

scripts/.DS_Store

6 KB
Binary file not shown.

src/.DS_Store

0 Bytes
Binary file not shown.

src/auth/.DS_Store

6 KB
Binary file not shown.

src/auth/auth.html

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<html>
2+
<head>
3+
<meta charset=utf-8 />
4+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
5+
<title>Google Sign In</title>
6+
7+
<link rel="stylesheet" href="main.css">
8+
9+
<script src="https://www.gstatic.com/firebasejs/7.5.0/firebase.js"></script>
10+
<script src="auth.js"></script>
11+
</head>
12+
<body>
13+
<h3>Firebase Authentication</h3>
14+
15+
<div class="user-details-container">
16+
<button id="sign-in-button">Sign-in with Google</button>
17+
<p>
18+
Firebase sign-in status: <span id="sign-in-status">Unknown</span>
19+
</p>
20+
</div>
21+
</body>
22+
</html>
Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,27 @@ var config = {
3535
var uid = user.uid;
3636
var providerData = user.providerData;
3737
// [START_EXCLUDE]
38-
document.getElementById('quickstart-button').textContent = 'Sign out';
39-
document.getElementById('quickstart-sign-in-status').textContent = 'Signed in';
40-
document.getElementById('quickstart-account-details').textContent = JSON.stringify(user, null, ' ');
38+
document.getElementById('sign-in-button').textContent = 'Sign out';
39+
document.getElementById('sign-in-status').textContent = 'Signed in';
40+
41+
// chrome.storage.local.set({logged_in: true});
42+
chrome.browserAction.setPopup({popup: "popup.html"});
4143
// [END_EXCLUDE]
4244
} else {
4345
// Let's try to get a Google auth token programmatically.
4446
// [START_EXCLUDE]
45-
document.getElementById('quickstart-button').textContent = 'Sign-in with Google';
46-
document.getElementById('quickstart-sign-in-status').textContent = 'Signed out';
47-
document.getElementById('quickstart-account-details').textContent = 'null';
47+
document.getElementById('sign-in-button').textContent = 'Sign-in with Google';
48+
document.getElementById('sign-in-status').textContent = 'Signed out';
49+
50+
// chrome.storage.local.set({logged_in: false});
51+
chrome.browserAction.setPopup({popup: "auth.html"});
4852
// [END_EXCLUDE]
4953
}
50-
document.getElementById('quickstart-button').disabled = false;
54+
document.getElementById('sign-in-button').disabled = false;
5155
});
5256
// [END authstatelistener]
5357

54-
document.getElementById('quickstart-button').addEventListener('click', startSignIn, false);
58+
document.getElementById('sign-in-button').addEventListener('click', startSignIn, false);
5559
}
5660

5761
/**
@@ -86,7 +90,7 @@ var config = {
8690
* Starts the sign-in process.
8791
*/
8892
function startSignIn() {
89-
document.getElementById('quickstart-button').disabled = true;
93+
document.getElementById('sign-in-button').disabled = true;
9094
if (firebase.auth().currentUser) {
9195
firebase.auth().signOut();
9296
} else {

src/auth/credentials.html

Lines changed: 0 additions & 24 deletions
This file was deleted.

src/auth/main.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ html, body {
2121
.mdl-layout__header-row {
2222
padding: 0;
2323
}
24-
.quickstart-user-details-container {
24+
.user-details-container {
2525
margin-top: 20px;
2626
line-height: 25px;
2727
}
28-
#quickstart-sign-in-status {
28+
#sign-in-status {
2929
font-weight: bold;
3030
}
3131
pre {
@@ -37,7 +37,7 @@ html, body {
3737
word-break: break-all;
3838
}
3939
h3 {
40-
background: url('firebase-logo.png') no-repeat;
40+
background: url('fn-logo.png') no-repeat;
4141
background-size: 40px;
4242
padding-left: 50px;
4343
line-height: 40px;
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
<!DOCTYPE html>
2+
13
<html>
24
<head>
35
<meta charset=utf-8 />
@@ -8,7 +10,7 @@
810
<link rel="stylesheet" href="main.css">
911

1012
<script src="https://www.gstatic.com/firebasejs/7.5.0/firebase.js"></script>
11-
<script src="../background.js"></script>
13+
<script src="background.js"></script>
1214
</head>
1315
<body>
1416

0 commit comments

Comments
 (0)